[Refactor] Change GregorianCalendar.day_events() to a static method

It takes a date as its parameter, and doesn’t use the class’ timestamp, so there’s no point making
it an instance method.
This commit is contained in:
Gergely Polonkai 2018-07-03 08:28:12 +02:00
parent 894024aa88
commit 9dd2a1120f

View File

@ -142,7 +142,8 @@ class GregorianCalendar(CalendarSystem):
return now >= month_start_timestamp and now < month_end_timestamp
def day_events(self, date, user=None):
@staticmethod
def day_events(date, user=None):
from ..models import Event
events = Event.query