From 64bc1791d45ff96491a0909a6d9728d1bdf3eb6d Mon Sep 17 00:00:00 2001 From: Alex Barcelo Date: Wed, 16 Dec 2015 15:06:19 +0100 Subject: [PATCH] removing completely QueueMembership model --- .../migrations/0010_remove_queuemembership.py | 30 +++++++++++++++++++ helpdesk/models.py | 23 -------------- 2 files changed, 30 insertions(+), 23 deletions(-) create mode 100644 helpdesk/migrations/0010_remove_queuemembership.py diff --git a/helpdesk/migrations/0010_remove_queuemembership.py b/helpdesk/migrations/0010_remove_queuemembership.py new file mode 100644 index 00000000..a43d467b --- /dev/null +++ b/helpdesk/migrations/0010_remove_queuemembership.py @@ -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', + ), + ] diff --git a/helpdesk/models.py b/helpdesk/models.py index 70cce880..664fec8d 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -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')