|
|
@ -21,7 +21,6 @@ class OsobaAdmin(admin.ModelAdmin): |
|
|
|
|
|
|
|
def udelej_orgem(self,request,queryset): |
|
|
|
org_group = Group.objects.get(name='org') |
|
|
|
print(queryset) |
|
|
|
for o in queryset: |
|
|
|
if m.Organizator.objects.filter(osoba=o).exists(): continue |
|
|
|
user = o.user |
|
|
@ -30,7 +29,7 @@ class OsobaAdmin(admin.ModelAdmin): |
|
|
|
user.save() |
|
|
|
org = m.Organizator.objects.create(osoba=o, organizuje_od=datetime.now()) |
|
|
|
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" |
|
|
|
|
|
|
|
class OsobaInline(admin.TabularInline): |
|
|
|
model = m.Osoba |
|
|
|