From 9dd2a1120f969f35682f6ab6196a86ff3c812c72 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 3 Jul 2018 08:28:12 +0200 Subject: [PATCH] [Refactor] Change GregorianCalendar.day_events() to a static method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It takes a date as its parameter, and doesn’t use the class’ timestamp, so there’s no point making it an instance method. --- calsocial/calendar_system/gregorian.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/calsocial/calendar_system/gregorian.py b/calsocial/calendar_system/gregorian.py index b9dd802..0967b0d 100644 --- a/calsocial/calendar_system/gregorian.py +++ b/calsocial/calendar_system/gregorian.py @@ -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