Lepsi Delani Orgu #35

Merged
zelvuska merged 6 commits from lepsi-delani-orgu into master 2023-10-30 22:21:13 +01:00
Showing only changes of commit 844c55d5a7 - Show all commits

View file

@ -21,7 +21,6 @@ class OsobaAdmin(admin.ModelAdmin):
def udelej_orgem(self,request,queryset): def udelej_orgem(self,request,queryset):
org_group = Group.objects.get(name='org') org_group = Group.objects.get(name='org')
print(queryset)
for o in queryset: for o in queryset:
ledoian marked this conversation as resolved
Review

Tenhle print tu být taky nemusí…

Tenhle print tu být taky nemusí…
if m.Organizator.objects.filter(osoba=o).exists(): continue if m.Organizator.objects.filter(osoba=o).exists(): continue
user = o.user user = o.user
@ -30,7 +29,7 @@ class OsobaAdmin(admin.ModelAdmin):
user.save() user.save()
org = m.Organizator.objects.create(osoba=o, organizuje_od=datetime.now()) org = m.Organizator.objects.create(osoba=o, organizuje_od=datetime.now())
org.save() org.save()
udelej_orgem.short_description = "Udělej vybraných osob organizátory" udelej_orgem.short_description = "Udělej z vybraných osob organizátory"
ledoian marked this conversation as resolved Outdated

s/j v/j z v/

s/j v/j z v/
class OsobaInline(admin.TabularInline): class OsobaInline(admin.TabularInline):
model = m.Osoba model = m.Osoba