Skip to content
Snippets Groups Projects
Commit 63490e2f authored by Valentin Groues's avatar Valentin Groues :eyes:
Browse files

change redirection after editing appointments - fixes #116

parent 19dff1c1
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -23,7 +23,8 @@
{% block content %}
<div class="box box-info">
<div class="box-header with-border">
<a href="javascript:history.back(1)" class="btn btn-block btn-default">Back</a>
<a href="{% url 'web.views.subject_edit' id %}"
class="btn btn-block btn-default">Subject</a>
<a href="{% url 'web.views.visit_add' id %}" type="button" class="btn btn-block btn-default">Add
visit</a>
</div>
......
......@@ -25,7 +25,6 @@
{% block content %}
<div class="box box-info">
<div class="box-header with-border">
<a href="javascript:history.back(1)" class="btn btn-block btn-default">Back</a>
<a href="{% url 'web.views.subject_visit_details' visit.subject.id %}" type="button"
class="btn btn-block btn-default">Subject's visits</a>
</div>
......@@ -132,7 +131,7 @@
</td>
<td>
{% ifequal app.status "SCHEDULED" %}
<a href="{% url 'web.views.appointment_edit' app.id %}" type="button"
<a href="{% url 'web.views.appointment_edit' app.id %}?from_visit" type="button"
class="btn btn-block btn-default">Edit</a>
{% else %}
{{ app.status }}
......@@ -176,7 +175,6 @@
<div class="box-footer">
<td><a href="{% url 'web.views.subject_edit' visit.subject.id %}" type="button"
class="btn btn-block btn-default">Edit subject</a></td>
<a href="javascript:history.back(1)" class="btn btn-block btn-default">Back</a>
</div><!-- /.box-footer -->
</form>
</div>
......
......@@ -85,8 +85,7 @@ def appointment_edit(request, id):
messages.success(request, "Modifications saved")
if '_continue' in request.POST:
return redirect('web.views.appointment_edit', id=the_appointment.id)
if (the_appointment.status != Appointment.APPOINTMENT_STATUS_SCHEDULED) and (
the_appointment.visit is not None):
if 'from_visit' in request.GET:
return redirect('web.views.visit_details', id=the_appointment.visit.id)
else:
return redirect('web.views.appointments')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment