Skip to content
Snippets Groups Projects
Commit f9505e71 authored by Jacek Lebioda's avatar Jacek Lebioda
Browse files

Small naming refactoring, getting close to java

parent 815e2345
No related branches found
No related tags found
No related merge requests found
......@@ -169,15 +169,15 @@ class Visit(models.Model):
def __str__(self):
return "%s %s" % (self.subject.first_name, self.subject.last_name)
def checkIfFinished(self):
appvis = self.appointment_set.all()
def end_if_appointments_were_finished(self):
the_appointments = self.appointment_set.all()
finished = True
for app in appvis:
if(app.is_finished == False):
for appointment in the_appointments:
if appointment.is_finished == False:
finished = False
if (finished):
if finished:
self.is_finished = True
self.save()
......
......@@ -312,7 +312,7 @@ def appointment_edit(request, id):
data = form.cleaned_data
vis = data['visit']
visit = Visit.objects.get(id=vis.id)
visit.checkIfFinished()
visit.end_if_appointments_were_finished()
return redirect(appointments)
else:
......
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