Skip to content

Commit

Permalink
Fix issue with Python 3.4, Django 1.6
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Finucane <[email protected]>
Fixes: 866d14b ("models: Fix invocation of refresh_tag_counts() for Comments")
  • Loading branch information
stephenfin committed Aug 23, 2017
1 parent debfe66 commit fb7321b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions patchwork/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fb7321b

Please sign in to comment.