]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
views: Don't use attr(X, 'patch')
authorStephen Finucane <stephen@that.guru>
Sat, 19 Nov 2016 20:43:16 +0000 (20:43 +0000)
committerStephen Finucane <stephen@that.guru>
Sat, 19 Nov 2016 20:43:16 +0000 (20:43 +0000)
This doesn't play nice with Django 1.6 under Python 3.4, for some odd
reason.

Signed-off-by: Stephen Finucane <stephen@that.guru>
patchwork/views/comment.py

index 92e2355cd5cbe685651d2124a4f0589f6785603b..71751052b1e3b654e70ec464db42d3b2e4e96eff 100644 (file)
@@ -29,7 +29,7 @@ from patchwork import models
 def comment(request, comment_id):
     submission = shortcuts.get_object_or_404(models.Comment,
                                              id=comment_id).submission
-    if hasattr(submission, 'patch'):
+    if models.Patch.objects.filter(id=submission.id).exists():
         url = 'patch-detail'
         key = 'patch_id'
     else: