Lepsi Delani Orgu #35
1 changed files with 1 additions and 2 deletions
|
@ -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
|
|||||||
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"
|
||||||
|
|
||||||
class OsobaInline(admin.TabularInline):
|
class OsobaInline(admin.TabularInline):
|
||||||
model = m.Osoba
|
model = m.Osoba
|
||||||
|
|
Loading…
Reference in a new issue
Tenhle print tu být taky nemusí…