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

calendar view should have also finished appointments added

parent 4fd6cdff
No related branches found
No related tags found
1 merge request!1Appointments dev
...@@ -326,7 +326,7 @@ def appointments(request): ...@@ -326,7 +326,7 @@ def appointments(request):
today_midnight = datetime.datetime(today.year,today.month,today.day) today_midnight = datetime.datetime(today.year,today.month,today.day)
month_ago = today +datetime.timedelta(days=-31) month_ago = today +datetime.timedelta(days=-31)
approaching_list = Appointment.objects.filter(datetime_when__gt = today_midnight, is_finished = False).order_by('datetime_when') approaching_list = Appointment.objects.filter(datetime_when__gt = today_midnight, is_finished = False).order_by('datetime_when')
full_list = Appointment.objects.filter(datetime_when__gt = month_ago, is_finished = False).order_by('datetime_when') full_list = Appointment.objects.filter(datetime_when__gt = month_ago).order_by('datetime_when')
for plan in planning_list: for plan in planning_list:
...@@ -350,7 +350,7 @@ def appointment_add(request, id): ...@@ -350,7 +350,7 @@ def appointment_add(request, id):
today = datetime.datetime.now() today = datetime.datetime.now()
today_midnight = datetime.datetime(today.year,today.month,today.day) today_midnight = datetime.datetime(today.year,today.month,today.day)
month_ago = today +datetime.timedelta(days=-31) month_ago = today +datetime.timedelta(days=-31)
full_list = Appointment.objects.filter(datetime_when__gt = month_ago, is_finished = False).order_by('datetime_when') full_list = Appointment.objects.filter(datetime_when__gt = month_ago).order_by('datetime_when')
if request.method == 'POST': if request.method == 'POST':
form = AppointmentAddForm(request.POST, request.FILES) form = AppointmentAddForm(request.POST, request.FILES)
form.fields['visit'].widget = forms.HiddenInput() form.fields['visit'].widget = forms.HiddenInput()
......
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