mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Allow users to withdraw applications
This commit is contained in:
@@ -171,7 +171,7 @@ def update_application(request, applicationid, status):
|
|||||||
app = get_object_or_404(Application, id=applicationid)
|
app = get_object_or_404(Application, id=applicationid)
|
||||||
|
|
||||||
# Allow admins and users that are setting the application as awaiting review
|
# Allow admins and users that are setting the application as awaiting review
|
||||||
if hrstaff or (app.user == request.user and int(status) == APPLICATION_STATUS_AWAITINGREVIEW):
|
if hrstaff or app.user == request.user:
|
||||||
if not app.status == status:
|
if not app.status == status:
|
||||||
app.status = status
|
app.status = status
|
||||||
app.save(user=request.user)
|
app.save(user=request.user)
|
||||||
|
|||||||
@@ -20,6 +20,8 @@
|
|||||||
<p>
|
<p>
|
||||||
{% if app.status < 1 %}
|
{% if app.status < 1 %}
|
||||||
<a href="{% url hr.views.update_application app.id 1 %}">Submit Application</a>,
|
<a href="{% url hr.views.update_application app.id 1 %}">Submit Application</a>,
|
||||||
|
{% else %}
|
||||||
|
<a href="{% url hr.views.update_application app.id 0 %}">Withdraw Application</a>,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if hrstaff %}
|
{% if hrstaff %}
|
||||||
<a href="{% url hr.views.add_note app.id %}">Add Note</a>,
|
<a href="{% url hr.views.add_note app.id %}">Add Note</a>,
|
||||||
|
|||||||
Reference in New Issue
Block a user