def _process(self): form = UpcomingEventsForm(obj=FormDefaults(**upcoming_events_settings.get_all())) if form.validate_on_submit(): upcoming_events_settings.set_multi(form.data) get_upcoming_events.clear_cached() flash(_('Settings saved!'), 'success') return redirect(url_for('categories.manage_upcoming')) return WPManageUpcomingEvents.render_template('admin/upcoming_events.html', form=form)