Make the time zone on the event creation form default to the user’s time zone
This commit is contained in:
parent
a862e6ca5d
commit
d36817ca44
@ -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
Block a user