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

unnecessary code removed

parent 60e7fdd6
No related branches found
No related tags found
1 merge request!35performance on appointment list
# coding=utf-8
from django.shortcuts import get_object_or_404, redirect
from notifications import get_today_midnight_date, get_filter_locations, get_calendar_full_appointments, \
get_unfinished_appointments
from . import wrap_response
from ..forms import AppointmentDetailForm, AppointmentAddForm, AppointmentEditForm, SubjectEditForm
from ..models import Appointment
......
......@@ -241,12 +241,4 @@ def get_filter_locations(user):
def get_today_midnight_date():
today = datetime.datetime.now()
today_midnight = datetime.datetime(today.year, today.month, today.day)
return today_midnight
def get_calendar_full_appointments(user):
month_ago = get_today_midnight_date() + datetime.timedelta(days=-31)
return Appointment.objects.filter(
datetime_when__gt=month_ago,
location__in=get_filter_locations(user),
).order_by('datetime_when')
return today_midnight
\ No newline at end of file
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