mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-08-16 02:48:00 +02:00
Merge pull request #369 from alexbarcelo/always_create_permission
creation of Permission-per-Queue is done always
This commit is contained in:
@ -276,16 +276,15 @@ class Queue(models.Model):
|
||||
self.email_box_port = 110
|
||||
|
||||
if not self.id:
|
||||
# Always prepare the permission codename
|
||||
# Prepare the permission codename and the permission
|
||||
# (even if they are not needed with the current configuration)
|
||||
basename = self.prepare_permission_name()
|
||||
|
||||
# Create the permission only if the flag is active
|
||||
if helpdesk_settings.HELPDESK_ENABLE_PER_QUEUE_STAFF_PERMISSION:
|
||||
Permission.objects.create(
|
||||
name=_("Permission for queue: ") + self.title,
|
||||
content_type=ContentType.objects.get(model="queue"),
|
||||
codename=basename,
|
||||
)
|
||||
Permission.objects.create(
|
||||
name=_("Permission for queue: ") + self.title,
|
||||
content_type=ContentType.objects.get(model="queue"),
|
||||
codename=basename,
|
||||
)
|
||||
|
||||
super(Queue, self).save(*args, **kwargs)
|
||||
|
||||
|
Reference in New Issue
Block a user