Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/archive access bug #821

Merged
merged 4 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading