forked from gergely/calendar-social
[Code Cleanup] Update some variable names to conform with PEP8
This commit is contained in:
parent
9dd2a1120f
commit
5f5ccaa1ea
@ -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
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user