示例#1
0
文件: controllers.py 项目: fph/indico
 def _process(self):
     form = AdminAccountRegistrationForm()
     if form.validate_on_submit():
         data = form.data
         identity = Identity(provider='indico', identifier=data.pop('username'), password=data.pop('password'))
         user = create_user(data.pop('email'), data, identity, from_moderation=True)
         msg = Markup('{} <a href="{}">{}</a>').format(
             escape(_('The account has been created.')),
             url_for('users.user_profile', user),
             escape(_('Show details'))
         )
         flash(msg, 'success')
         return jsonify_data()
     return jsonify_template('users/users_admin_create.html', form=form)
示例#2
0
 def _process(self):
     form = AdminAccountRegistrationForm()
     if form.validate_on_submit():
         data = form.data
         identity = Identity(provider='indico', identifier=data.pop('username'), password=data.pop('password'))
         user = create_user(data.pop('email'), data, identity, from_moderation=True)
         msg = Markup('{} <a href="{}">{}</a>').format(
             escape(_('The account has been created.')),
             url_for('users.user_profile', user),
             escape(_('Show details'))
         )
         flash(msg, 'success')
         return jsonify_data()
     return jsonify_template('users/users_admin_create.html', form=form)