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
...@@ -133,14 +133,14 @@ ...@@ -133,14 +133,14 @@
Are you adding a new action type? Are you adding a new action type?
{% endif %} {% endif %}
{% if object.status == "PENDING" and request.user.is_superuser %} {% if object.status != "ACCEPTED" and request.user.is_superuser %}
<hr /> <hr />
<div id="request-buttons"> <div id="request-buttons">
<form method="POST"> <form method="POST">
{% csrf_token %} {% csrf_token %}
<p> <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> </p>
<button class="btn btn-danger" type="submit"> <button class="btn btn-danger" type="submit">
<i class="fa fa-thumbs-down"></i> <i class="fa fa-thumbs-down"></i>
......
...@@ -75,7 +75,7 @@ class RequestDetail(LoginRequiredMixin, DetailView): ...@@ -75,7 +75,7 @@ class RequestDetail(LoginRequiredMixin, DetailView):
if not user.is_superuser: if not user.is_superuser:
raise SuspiciousOperation raise SuspiciousOperation
if self.get_object().status == "PENDING": if self.get_object().status != "ACCEPTED":
accept = self.request.POST.get("accept") accept = self.request.POST.get("accept")
reason = self.request.POST.get("reason") reason = self.request.POST.get("reason")
if accept: 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