From 147d199c3dc6a78fabaf48af320eb64803d308c5 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Wed, 29 Oct 2014 12:48:11 +0100 Subject: [PATCH] Fixing problem with new notifications system on upload 2 equal attachments. --- .../migrations/0003_auto_20141029_1143.py | 18 ++++++++++++++++++ taiga/projects/notifications/models.py | 3 +++ 2 files changed, 21 insertions(+) create mode 100644 taiga/projects/notifications/migrations/0003_auto_20141029_1143.py diff --git a/taiga/projects/notifications/migrations/0003_auto_20141029_1143.py b/taiga/projects/notifications/migrations/0003_auto_20141029_1143.py new file mode 100644 index 00000000..1f5f6b93 --- /dev/null +++ b/taiga/projects/notifications/migrations/0003_auto_20141029_1143.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('notifications', '0002_historychangenotification'), + ] + + operations = [ + migrations.AlterUniqueTogether( + name='historychangenotification', + unique_together=set([('key', 'owner', 'project', 'history_type')]), + ), + ] diff --git a/taiga/projects/notifications/models.py b/taiga/projects/notifications/models.py index 1b62ce0a..6b631abc 100644 --- a/taiga/projects/notifications/models.py +++ b/taiga/projects/notifications/models.py @@ -67,3 +67,6 @@ class HistoryChangeNotification(models.Model): verbose_name="project",related_name="+") history_type = models.SmallIntegerField(choices=HISTORY_TYPE_CHOICES) + + class Meta: + unique_together = ("key", "owner", "project", "history_type")