Skip to content

Commit fb7321b

Browse files
committed
Fix issue with Python 3.4, Django 1.6
Signed-off-by: Stephen Finucane <[email protected]> Fixes: 866d14b ("models: Fix invocation of refresh_tag_counts() for Comments")
1 parent debfe66 commit fb7321b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

patchwork/models.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -574,8 +574,12 @@ class Comment(EmailMixin, models.Model):
574574

575575
def save(self, *args, **kwargs):
576576
super(Comment, self).save(*args, **kwargs)
577-
if hasattr(self.submission, 'patch'):
578-
self.submission.patch.refresh_tag_counts()
577+
# NOTE(stephenfin): Mitigate an issue with Python 3.4 + Django 1.6
578+
try:
579+
if hasattr(self.submission, 'patch'):
580+
self.submission.patch.refresh_tag_counts()
581+
except Patch.DoesNotExist:
582+
pass
579583

580584
def delete(self, *args, **kwargs):
581585
super(Comment, self).delete(*args, **kwargs)

0 commit comments

Comments
 (0)