From f48a743c247ed8533b59da81d4d03f6e8a448ca2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 1 Mar 2012 09:59:32 +0100 Subject: [PATCH] Bind suggestion to project --- trans/models.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trans/models.py b/trans/models.py index bc713091a..c612db043 100644 --- a/trans/models.py +++ b/trans/models.py @@ -415,9 +415,13 @@ class Unit(models.Model): return mark_safe('\n'.join(ret)) def suggestions(self): - return Suggestion.objects.filter(checksum = self.checksum) + return Suggestion.objects.filter( + checksum = self.checksum, + project = self.translation.subproject.project + ) class Suggestion(models.Model): checksum = models.CharField(max_length = 40, default = '', blank = True, db_index = True) target = models.TextField() user = models.ForeignKey(User, null = True, blank = True) + project = models.ForeignKey(Project)