mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-12-26 16:48:50 +01:00
removing completely QueueMembership model
This commit is contained in:
parent
d760d9ee95
commit
64bc1791d4
30
helpdesk/migrations/0010_remove_queuemembership.py
Normal file
30
helpdesk/migrations/0010_remove_queuemembership.py
Normal file
@ -0,0 +1,30 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('helpdesk', '0009_migrate_queuemembership'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='queuemembership',
|
||||
name='queues',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='queuemembership',
|
||||
name='user',
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='queue',
|
||||
name='permission_name',
|
||||
field=models.CharField(help_text='Name used in the django.contrib.auth permission system', max_length=50, null=True, verbose_name='Django auth permission name', blank=True),
|
||||
),
|
||||
migrations.DeleteModel(
|
||||
name='QueueMembership',
|
||||
),
|
||||
]
|
@ -1403,26 +1403,3 @@ class TicketDependency(models.Model):
|
||||
unique_together = ('ticket', 'depends_on')
|
||||
verbose_name = _('Ticket dependency')
|
||||
verbose_name_plural = _('Ticket dependencies')
|
||||
|
||||
|
||||
@python_2_unicode_compatible
|
||||
class QueueMembership(models.Model):
|
||||
"""
|
||||
Used to restrict staff members to certain queues only
|
||||
"""
|
||||
user = models.OneToOneField(
|
||||
settings.AUTH_USER_MODEL,
|
||||
verbose_name=_('User'),
|
||||
)
|
||||
|
||||
queues = models.ManyToManyField(
|
||||
Queue,
|
||||
verbose_name=_('Authorized Queues'),
|
||||
)
|
||||
|
||||
def __str__(self):
|
||||
return '%s authorized for queues %s' % (self.user, ", ".join(self.queues.values_list('title', flat=True)))
|
||||
|
||||
class Meta:
|
||||
verbose_name = _('Queue Membership')
|
||||
verbose_name_plural = _('Queue Memberships')
|
||||
|
Loading…
Reference in New Issue
Block a user