aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Finucane <stephen@that.guru>2017-08-23 19:05:49 +0100
committerStephen Finucane <stephen@that.guru>2017-08-23 19:06:23 +0100
commitfb7321bb36616d194313ab9d3151e508efb9b2a4 (patch)
tree19f6a30a3d0e8f81706197b5061c5e7eedec0319
parentdebfe66b200fe007cb91248eab1537af667c1238 (diff)
downloadpatchwork-fb7321bb36616d194313ab9d3151e508efb9b2a4.tar
patchwork-fb7321bb36616d194313ab9d3151e508efb9b2a4.tar.gz
Fix issue with Python 3.4, Django 1.6
Signed-off-by: Stephen Finucane <stephen@that.guru> Fixes: 866d14b4 ("models: Fix invocation of refresh_tag_counts() for Comments")
-rw-r--r--patchwork/models.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/patchwork/models.py b/patchwork/models.py
index f8d2472..d4075cf 100644
--- a/patchwork/models.py
+++ b/patchwork/models.py
@@ -574,8 +574,12 @@ class Comment(EmailMixin, models.Model):
def save(self, *args, **kwargs):
super(Comment, self).save(*args, **kwargs)
- if hasattr(self.submission, 'patch'):
- self.submission.patch.refresh_tag_counts()
+ # NOTE(stephenfin): Mitigate an issue with Python 3.4 + Django 1.6
+ try:
+ if hasattr(self.submission, 'patch'):
+ self.submission.patch.refresh_tag_counts()
+ except Patch.DoesNotExist:
+ pass
def delete(self, *args, **kwargs):
super(Comment, self).delete(*args, **kwargs)