Example #1
0
def send_mail_post():
    form = EmailForm(request.forms)
    if form.validate():
        user = User.objects(email=form.email.data).first()
        send_confirm_email(app.config, user.email)
        return redirect('/success_sendmail')
    return {'form': form}
Example #2
0
def send_email():
    form = EmailForm()
    if form.validate_on_submit():
        user = User.objects(email=form.email.data).first()
        send_confirm_email(current_app.config, user.email)
        return redirect('/success_sendmail')
    return render_template('sendmail.html', form=form)
Example #3
0
def send_mail_post():
    form = EmailForm(request.forms)
    if form.validate():
        user = User.objects(email=form.email.data).first()
        send_confirm_email(app.config, user.email)
        return redirect('/success_sendmail')
    return {'form': form}
Example #4
0
def send_email():
    form = EmailForm()
    if form.validate_on_submit():
        user = User.objects(email=form.email.data).first()
        send_confirm_email(current_app.config, user.email)
        return redirect('/success_sendmail')
    return render_template('sendmail.html',
                           form=form)
Example #5
0
def signup_post():
    form = SignupForm(request.forms)
    if form.validate():
        user = User()
        form.populate_obj(user)
        user.save()
        login.login_user(user.id)
        send_confirm_email(app.config, user.email)
        return redirect('/active_email')
    return {'form': form, 'token': request.csrf_token}
Example #6
0
def signup_post():
    form = SignupForm(request.forms)
    if form.validate():
        user = User()
        form.populate_obj(user)
        user.save()
        login.login_user(user.id)
        send_confirm_email(app.config, user.email)
        return redirect('/active_email')
    return {'form': form, 'token': request.csrf_token}
Example #7
0
def signup():
    form = SignupForm()
    if request.method == 'GET':
        return render_template('users/signup.html', form=form)
    else:
        if form.validate_on_submit():
            user = User()
            form.populate_obj(user)
            user.save()
            bookmark = Bookmark(user=user,
                                title=u"%s 的收藏夹" % user.username,
                                is_default=True)
            bookmark.save()
            user_mixin = LoginManagerUser(user)
            login_user(user_mixin)
            send_confirm_email(current_app.config, user.email)
            return redirect(url_for('site_app.index'))
        return render_template('users/signup.html', form=form)
Example #8
0
def signup():
    form = SignupForm()
    if request.method == 'GET':
        return render_template('users/signup.html',
                               form=form)
    else:
        if form.validate_on_submit():
            user = User()
            form.populate_obj(user)
            user.save()
            bookmark = Bookmark(user=user,
                                title=u"%s 的收藏夹" % user.username,
                                is_default=True)
            bookmark.save()
            user_mixin = LoginManagerUser(user)
            login_user(user_mixin)
            send_confirm_email(current_app.config, user.email)
            return redirect(url_for('site_app.index'))
        return render_template('users/signup.html',
                               form=form)