def _process(self): form = ApplicationForm(obj=self.application, application=self.application) if form.validate_on_submit(): form.populate_obj(self.application) flash(_("Application {} was modified").format(self.application.name), 'success') return redirect(url_for('.apps')) return WPOAuthAdmin.render_template('app_details.html', application=self.application, form=form)
def _process(self): form = ApplicationForm(obj=self.application, application=self.application) if form.validate_on_submit(): form.populate_obj(self.application) logger.info("Application %s updated by %s", self.application, session.user) flash(_("Application {} was modified").format(self.application.name), 'success') return redirect(url_for('.apps')) return WPOAuthAdmin.render_template('app_details.html', application=self.application, form=form)
def _process(self): form = ApplicationForm(obj=FormDefaults(is_enabled=True)) if form.validate_on_submit(): application = OAuthApplication() form.populate_obj(application) db.session.add(application) db.session.flush() flash(_("Application {} registered successfully").format(application.name), 'success') return redirect(url_for('.app_details', application)) return WPOAuthAdmin.render_template('app_new.html', form=form)
def _process(self): form = ApplicationForm(obj=self.application, application=self.application) disabled_fields = set(self.application.system_app_type.enforced_data) if form.validate_on_submit(): form.populate_obj(self.application) logger.info("Application %s updated by %s", self.application, session.user) flash(_("Application {} was modified").format(self.application.name), 'success') return redirect(url_for('.apps')) return WPOAuthAdmin.render_template('app_details.html', application=self.application, form=form, disabled_fields=disabled_fields)
def _process(self): form = ApplicationForm(obj=FormDefaults(is_enabled=True)) if form.validate_on_submit(): application = OAuthApplication() form.populate_obj(application) db.session.add(application) db.session.flush() logger.info("Application %s created by %s", application, session.user) flash(_("Application {} registered successfully").format(application.name), 'success') return redirect(url_for('.app_details', application)) return WPOAuthAdmin.render_template('app_new.html', form=form)
def _process(self): form = ApplicationForm(obj=self.application, application=self.application) disabled_fields = set(self.application.system_app_type.enforced_data) if form.validate_on_submit(): form.populate_obj(self.application) logger.info('Application %s updated by %s', self.application, session.user) flash( _('Application {} was modified').format(self.application.name), 'success') return redirect(url_for('.apps')) return WPOAuthAdmin.render_template('app_details.html', application=self.application, form=form, disabled_fields=disabled_fields)