Make the user’s time zone the default when creating a new event #88
|
@ -213,6 +213,13 @@ class EventForm(FlaskForm):
|
||||||
description = StringField(_('Description'), widget=TextArea())
|
description = StringField(_('Description'), widget=TextArea())
|
||||||
visibility = EnumField(EventVisibility, EVENT_VISIBILITY_TRANSLATIONS, label=_('Visibility'))
|
visibility = EnumField(EventVisibility, EVENT_VISIBILITY_TRANSLATIONS, label=_('Visibility'))
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
from flask_security import current_user
|
||||||
|
|
||||||
|
self.time_zone.kwargs['default'] = current_user.timezone
|
||||||
|
|
||||||
|
FlaskForm.__init__(self, *args, **kwargs)
|
||||||
|
|
||||||
def populate_obj(self, obj):
|
def populate_obj(self, obj):
|
||||||
"""Populate ``obj`` with event data
|
"""Populate ``obj`` with event data
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue