From 5032b342b0d4c386f981f15727fa3d85e5f8823c Mon Sep 17 00:00:00 2001 From: Tudor Amariei Date: Mon, 21 Oct 2024 12:51:51 +0300 Subject: [PATCH] Remove own support for NGOs --- .../hub/templates/hub/candidate/detail.html | 31 ++++++++++++------- backend/hub/views.py | 2 +- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/backend/hub/templates/hub/candidate/detail.html b/backend/hub/templates/hub/candidate/detail.html index dcbf16b5..80d1cd7e 100644 --- a/backend/hub/templates/hub/candidate/detail.html +++ b/backend/hub/templates/hub/candidate/detail.html @@ -61,14 +61,17 @@ {% if can_support_candidate %}
- {% if supported_candidate %} - - Retrage susținerea - - {% else %} - - Susține - + + {% if not own_candidate %} + {% if supported_candidate %} + + Retrage susținerea + + {% else %} + + Susține + + {% endif %} {% endif %} {% trans "Supporters:" %} {{ candidate.count_supporters }} @@ -83,11 +86,17 @@ {% if can_vote_candidate %} {% if voted_candidate %} - {% trans "✔ VOTED" %} + + {% trans "✔ VOTED" %} + {% elif used_all_domain_votes %} - {% trans "You have used all the votes allotted for this domain." %} + + {% trans "You have used all the votes allotted for this domain." %} + {% else %} - {% trans "Vote" %} + + {% trans "Vote" %} + {% endif %} {% endif %} diff --git a/backend/hub/views.py b/backend/hub/views.py index 036645ba..8338c0f3 100644 --- a/backend/hub/views.py +++ b/backend/hub/views.py @@ -742,7 +742,7 @@ def candidate_support(request, pk): if not FeatureFlag.flag_enabled("enable_candidate_supporting"): raise PermissionDenied - user = request.user + user: User = request.user user_org = user.organization if user_org.status != Organization.STATUS.accepted: raise PermissionDenied