From 5f5ccaa1ea285c5875f388b5f2a300220f78fd29 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Tue, 3 Jul 2018 08:27:17 +0200 Subject: [PATCH] [Code Cleanup] Update some variable names to conform with PEP8 --- calsocial/calendar_system/gregorian.py | 12 ++++++------ calsocial/forms.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/calsocial/calendar_system/gregorian.py b/calsocial/calendar_system/gregorian.py index 0967b0d..f80a767 100644 --- a/calsocial/calendar_system/gregorian.py +++ b/calsocial/calendar_system/gregorian.py @@ -92,11 +92,11 @@ class GregorianCalendar(CalendarSystem): @property def prev_month_name(self): if self.timestamp.month == 1: - ts = self.prev_year.replace(month=12) + timestamp = self.prev_year.replace(month=12) else: - ts = self.timestamp.replace(month=self.timestamp.month - 1) + timestamp = self.timestamp.replace(month=self.timestamp.month - 1) - return self.month_names[ts.month - 1] + return self.month_names[timestamp.month - 1] @property @to_timestamp @@ -109,11 +109,11 @@ class GregorianCalendar(CalendarSystem): @property def next_month_name(self): if self.timestamp.month == 12: - ts = self.prev_year.replace(month=1) + timestamp = self.prev_year.replace(month=1) else: - ts = self.timestamp.replace(month=self.timestamp.month + 1) + timestamp = self.timestamp.replace(month=self.timestamp.month + 1) - return self.month_names[ts.month - 1] + return self.month_names[timestamp.month - 1] @property @to_timestamp diff --git a/calsocial/forms.py b/calsocial/forms.py index a93504b..3b0e4b6 100644 --- a/calsocial/forms.py +++ b/calsocial/forms.py @@ -78,11 +78,11 @@ class EventForm(FlaskForm): def populate_obj(self, obj): FlaskForm.populate_obj(self, obj) - tz = self.time_zone.data + timezone = self.time_zone.data - obj.time_zone = str(tz) - obj.start_time = tz.localize(self.start_time.data).astimezone(pytz.utc) - obj.end_time = tz.localize(self.end_time.data).astimezone(pytz.utc) + obj.time_zone = str(timezone) + obj.start_time = timezone.localize(self.start_time.data).astimezone(pytz.utc) + obj.end_time = timezone.localize(self.end_time.data).astimezone(pytz.utc) def validate_end_time(self, field): if field.data < self.start_time.data: