From 25df34e57ea1697cbee4d7b673b9c816e1ab383c Mon Sep 17 00:00:00 2001 From: Ludovic Stephan Date: Mon, 24 Jul 2017 15:30:16 +0200 Subject: [PATCH] Add filter to permissions --- event/signals.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/event/signals.py b/event/signals.py index 040fc37..98c62cc 100644 --- a/event/signals.py +++ b/event/signals.py @@ -17,7 +17,9 @@ def create_groups_for_event(sender, **kwargs): 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) GEGroup.objects.create(