From 8db00b2d7c688760288994ace9a48ecf65cdd770 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 18 2017 11:44:34 +0000 Subject: Fix the unit-tests The logic in the template was using `and` and `or` but the logic in the second block of that `or` was trying to access `g.fas_user` which was checked before. By fixing the logic fixed the tests that triggered off this faulty logic Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/_formhelper.html b/pagure/templates/_formhelper.html index 1828354..145df57 100644 --- a/pagure/templates/_formhelper.html +++ b/pagure/templates/_formhelper.html @@ -144,18 +144,18 @@ {% endif %} - {% if id != 0 and g.fas_user and g.repo_committer or ( + {% if id != 0 and g.fas_user and (g.repo_committer or ( comment.parent.status in [True, 'Open'] - and g.fas_user.username == comment.user.username) %} + and g.fas_user.username == comment.user.username)) %} {% endif %} - {% if id != 0 and g.fas_user and g.repo_committer or ( + {% if id != 0 and g.fas_user and (g.repo_committer or ( comment.parent.status in [True, 'Open'] - and g.fas_user.username == comment.user.username) %} + and g.fas_user.username == comment.user.username)) %}