Skip to content
Snippets Groups Projects
Commit 5068f374 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

subject.informatio_sent is set to true after finishing appointment

parent b17e5bdb
No related branches found
No related tags found
1 merge request!39Subject additional fields added
......@@ -3,7 +3,7 @@ from django.shortcuts import get_object_or_404, redirect
from . import wrap_response
from ..forms import AppointmentDetailForm, AppointmentAddForm, AppointmentEditForm, SubjectEditForm
from ..models import Appointment
from ..models import Appointment, Subject
APPOINTMENT_LIST_GENERIC = "GENERIC"
APPOINTMENT_LIST_UNFINISHED = "UNFINISHED"
......@@ -75,6 +75,12 @@ def appointment_edit(request, id):
if subject_form is not None:
subject_form.save()
the_appointment = get_object_or_404(Appointment, id=id)
if the_appointment.status == Appointment.APPOINTMENT_STATUS_FINISHED:
subject = Subject.objects.get(id=the_appointment.visit.subject.id)
subject.information_sent = True
subject.save()
if (the_appointment.status != Appointment.APPOINTMENT_STATUS_SCHEDULED) and (
the_appointment.visit is not None):
return redirect('web.views.visit_details', id=the_appointment.visit.id)
......
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