diff --git a/main/templates/main/index.html b/main/templates/main/index.html index 5586509e..dd4df4f8 100644 --- a/main/templates/main/index.html +++ b/main/templates/main/index.html @@ -86,8 +86,10 @@

{% trans "Voordat je begint" %}

href="{% url 'proposals:copy_revision' %}">{% trans "Nieuwe revisie starten" %} {% trans "Nieuw amendement starten" %} - {% trans "Archief" %} + {% if can_view_archive %} + {% trans "Archief" %} + {% endif %}
diff --git a/main/views.py b/main/views.py index d4f0175b..bcd81388 100644 --- a/main/views.py +++ b/main/views.py @@ -124,6 +124,7 @@ def get_context_data(self, *args, **kwargs): context["is_humanities"] = is_member_of_humanities(self.request.user) context["proposals"] = self.get_priority_proposals() + context["can_view_archive"] = can_view_archive(self.request.user) return context @@ -426,6 +427,8 @@ class HumanitiesOrPrivilegeRequiredMixin(UserPassesTestMixin): to a privileged set of groups. """ + raise_exception = True + def test_func(self, user): return can_view_archive(user) diff --git a/proposals/utils/proposal_utils.py b/proposals/utils/proposal_utils.py index 04b82eb2..210097b4 100644 --- a/proposals/utils/proposal_utils.py +++ b/proposals/utils/proposal_utils.py @@ -30,6 +30,7 @@ "OverwriteStorage", ] + def generate_ref_number(): """ Generates a reference number for a new(!) Proposal.