[FIX] calendar: set context if none
Avoid traceback if no context in get_recurrent_date_by_event when code do:
context.get('xx')
This commit is contained in:
@@ -701,6 +701,9 @@ class calendar_event(osv.Model):
|
||||
val = pytz.UTC.localize(val)
|
||||
return val.astimezone(timezone)
|
||||
|
||||
if context is None:
|
||||
context = {}
|
||||
|
||||
timezone = pytz.timezone(context.get('tz') or 'UTC')
|
||||
startdate = pytz.UTC.localize(datetime.strptime(event.start, DEFAULT_SERVER_DATETIME_FORMAT)) # Add "+hh:mm" timezone
|
||||
if not startdate:
|
||||
|
||||
Reference in New Issue
Block a user