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.
This commit is contained in:
Jonathan Barratt 2017-01-13 17:52:29 +07:00
parent aa2265ccb1
commit 2f66c50320
No known key found for this signature in database
GPG Key ID: C007F833B47313DA

View File

@ -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,
)