removing completely QueueMembership model

This commit is contained in:
Alex Barcelo 2015-12-16 15:06:19 +01:00
parent d760d9ee95
commit 64bc1791d4
2 changed files with 30 additions and 23 deletions

View 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',
),
]

View File

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