Commit a2c993ac by Chif Gergő

request: Declined request can be changed

The TextBox is showed in PENDING and DECLINED requests. So the reason can be modified after decline the request.
parent 2c1b819a
Pipeline #680 passed with stage
in 0 seconds
......@@ -133,14 +133,14 @@
Are you adding a new action type?
{% endif %}
{% if object.status == "PENDING" and request.user.is_superuser %}
{% if object.status != "ACCEPTED" and request.user.is_superuser %}
<hr />
<div id="request-buttons">
<form method="POST">
{% csrf_token %}
<p>
<textarea class="form-control" placeholder="{% trans "Reason (sent to the user if the request is declined)" %}" name="reason"></textarea>
<textarea class="form-control" placeholder="{% trans "Reason (sent to the user if the request is declined)" %}" name="reason">{{object.reason}}</textarea>
</p>
<button class="btn btn-danger" type="submit">
<i class="fa fa-thumbs-down"></i>
......
......@@ -75,7 +75,7 @@ class RequestDetail(LoginRequiredMixin, DetailView):
if not user.is_superuser:
raise SuspiciousOperation
if self.get_object().status == "PENDING":
if self.get_object().status != "ACCEPTED":
accept = self.request.POST.get("accept")
reason = self.request.POST.get("reason")
if accept:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment