コード例 #1
0
ファイル: account.py プロジェクト: Gwill/zerqu
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
ファイル: sendmails.py プロジェクト: 343829084/zerqu
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