def _create(event, position, tpl_type, title, rules, stop_on_match): tpl = build_default_email_template(event, tpl_type) tpl.position = position tpl.title = title tpl.rules = rules tpl.stop_on_match = stop_on_match return tpl
def _process(self): form = CreateEmailTemplateForm(event=self.event_new) if form.validate_on_submit(): new_tpl = build_default_email_template(self.event_new, form.default_tpl.data) form.populate_obj(new_tpl) self.event_new.abstract_email_templates.append(new_tpl) db.session.flush() return _render_notification_list(self.event_new) return jsonify_template('events/abstracts/management/notification_tpl_form.html', form=form)