Skip to content

Commit

Permalink
Merge pull request #821 from DH-IT-Portal-Development/fix/archive_acc…
Browse files Browse the repository at this point in the history
…ess_bug

Fix/archive access bug
  • Loading branch information
EdoStorm96 authored Dec 16, 2024
2 parents ebb4033 + fbdcd5d commit 6cf6a38
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions main/templates/main/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ <h2>{% trans "Voordat je begint" %}</h2>
href="{% url 'proposals:copy_revision' %}">{% trans "Nieuwe revisie starten" %}</a>
<a class="btn btn-outline-secondary"
href="{% url 'proposals:copy_amendment' %}">{% trans "Nieuw amendement starten" %}</a>
<a class="btn btn-outline-secondary"
href="{% url 'proposals:archive' 'LK' %}">{% trans "Archief" %}</a>
{% if can_view_archive %}
<a class="btn btn-outline-secondary"
href="{% url 'proposals:archive' 'LK' %}">{% trans "Archief" %}</a>
{% endif %}
</div>
<div class="uu-container">
<div class="row gx-3 gy-4">
Expand Down
3 changes: 3 additions & 0 deletions main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions proposals/utils/proposal_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"OverwriteStorage",
]


def generate_ref_number():
"""
Generates a reference number for a new(!) Proposal.
Expand Down

0 comments on commit 6cf6a38

Please sign in to comment.