Exemplo n.º 1
0
 def _process(self):
     form = AdminSettingsForm(obj=FormDefaults(**api_settings.get_all()))
     if form.validate_on_submit():
         api_settings.set_multi(form.data)
         flash(_('Settings saved'), 'success')
         return redirect(url_for('.admin_settings'))
     count = APIKey.find(is_active=True).count()
     return WPAPIAdmin.render_template('admin_settings.html', form=form, count=count)
Exemplo n.º 2
0
 def _process(self):
     form = AdminSettingsForm(obj=FormDefaults(**api_settings.get_all()))
     if form.validate_on_submit():
         api_settings.set_multi(form.data)
         flash(_('Settings saved'), 'success')
         return redirect(url_for('.admin_settings'))
     count = APIKey.find(is_active=True).count()
     return WPAPIAdmin.render_template('admin_settings.html', form=form, count=count)