Пример #1
0
def delete_topic(token):
    key = 'account:delete-topic:%s' % token
    tid = redis.get(key)
    if not tid:
        abort(404)

    topic = Topic.query.get_or_404(int(tid))
    title = topic.title
    form = Form()
    show_message = False
    if form.validate_on_submit():
        with db.auto_commit():
            db.session.delete(topic)
        show_message = True
    return render_template(
        'account/delete-topic.html',
        title=title,
        form=form,
        show_message=show_message,
    )
Пример #2
0
def delete_topic(token):
    key = 'account:delete-topic:%s' % token
    tid = redis.get(key)
    if not tid:
        abort(404)

    topic = Topic.query.get_or_404(int(tid))
    title = topic.title
    form = Form()
    show_message = False
    if form.validate_on_submit():
        with db.auto_commit():
            db.session.delete(topic)
        show_message = True
    return render_template(
        'account/delete-topic.html',
        title=title,
        form=form,
        show_message=show_message,
    )
Пример #3
0
def get_email_from_signature(token, alt='signup'):
    key = 'account:%s:%s' % (alt, token)
    email = redis.get(key)
    if not email:
        return abort(404)
    return email, key
Пример #4
0
def get_email_from_signature(token, alt='signup'):
    key = 'account:%s:%s' % (alt, token)
    email = redis.get(key)
    if not email:
        return abort(404)
    return email, key