Skip to content

Commit

Permalink
🚸 Always allow mods to change request status
Browse files Browse the repository at this point in the history
  • Loading branch information
pajowu committed Jan 27, 2025
1 parent aeeac1c commit 099e0f2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions froide/foirequest/models/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,9 +742,6 @@ def has_been_refused(self):
def awaits_classification(self):
return self.status == Status.AWAITING_CLASSIFICATION

def moderate_classification(self):
return self.awaits_classification() and self.available_for_moderator_action()

def available_for_moderator_action(self):
ago = timezone.now() - MODERATOR_CLASSIFICATION_OFFSET
return self.last_message < ago
Expand Down
4 changes: 2 additions & 2 deletions froide/foirequest/templates/foirequest/header/info-box.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h3 class="h5 info-box__title">{{ object.readable_status }}</h3>
{# body #}
<div class="info-box__body">
{# edit button #}
{% if object.moderate_classification and object|can_moderate_foirequest:request or object|can_write_foirequest:request %}
{% if object|can_moderate_foirequest:request or object|can_write_foirequest:request %}
<div id="set-status" class="bg-primary-subtle px-4 py-2 d-print-none">
<a href="#" class="info-box__edit-button">
<span class="{% if active_tab == 'set-status' %}d-none{% endif %}"><i class="fa fa-pencil" aria-hidden="true"></i> {% trans "Edit request status" %}</span>
Expand Down Expand Up @@ -208,7 +208,7 @@ <h3 class="h5 info-box__title">{{ object.readable_status }}</h3>
</li>
</ul>
{# edit interface #}
{% if object.moderate_classification and object|can_moderate_foirequest:request or object|can_write_foirequest:request %}
{% if object|can_moderate_foirequest:request or object|can_write_foirequest:request %}
<div class="info-box__edit-panel px-4 mt-2 mb-4 {% if active_tab != 'set-status' %}d-none{% endif %}">
<form class="disable-submit"
method="post"
Expand Down
3 changes: 0 additions & 3 deletions froide/foirequest/views/request_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ def set_status(request, slug):
if not can_write_foirequest(foirequest, request):
if not can_moderate_foirequest(foirequest, request):
return render_403(request)
else:
if not foirequest.moderate_classification():
return render_403(request)

form = FoiRequestStatusForm(request.POST, foirequest=foirequest)
if form.is_valid():
Expand Down

0 comments on commit 099e0f2

Please sign in to comment.