From 2f66c50320161b27e8f0651d8ae6ac97882496be Mon Sep 17 00:00:00 2001 From: Jonathan Barratt Date: Fri, 13 Jan 2017 17:52:29 +0700 Subject: [PATCH] Make helpdesk work in apps with their own queue models To avoid returning multiple content types when creating custom permissions, use ContentType.objects.get_for_model to lookup the content type for helpdesk.models.queue. --- helpdesk/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpdesk/models.py b/helpdesk/models.py index c39e733b..4dc28a36 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -320,7 +320,7 @@ class Queue(models.Model): Permission.objects.create( name=_("Permission for queue: ") + self.title, - content_type=ContentType.objects.get(model="queue"), + content_type=ContentType.objects.get_for_model(self.__class__), codename=basename, )