Add filter to permissions

This commit is contained in:
Ludovic Stephan 2017-07-24 15:30:16 +02:00
parent 910d8fe9c0
commit 25df34e57e

View file

@ -17,7 +17,9 @@ def create_groups_for_event(sender, **kwargs):
event=event event=event
) )
for perm in Permission.objects.filter(codename__contains="event_"): for perm in Permission.objects.filter(
content_type=ContentType.objects.get_for_model(Event),
codename__contains="event_"):
assign_perm(perm.codename, orgas, event) assign_perm(perm.codename, orgas, event)
GEGroup.objects.create( GEGroup.objects.create(