本文整理汇总了Python中formspree.forms.models.Form.confirm方法的典型用法代码示例。如果您正苦于以下问题:Python Form.confirm方法的具体用法?Python Form.confirm怎么用?Python Form.confirm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类formspree.forms.models.Form
的用法示例。
在下文中一共展示了Form.confirm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: confirm_email
# 需要导入模块: from formspree.forms.models import Form [as 别名]
# 或者: from formspree.forms.models.Form import confirm [as 别名]
def confirm_email(nonce):
"""
Confirmation emails point to this endpoint
It either rejects the confirmation or
flags associated email+host to be confirmed
"""
# get the form for this request
form = Form.confirm(nonce)
if not form:
return (
render_template(
"error.html",
title="Not a valid link",
text="Confirmation token not found.<br />Please check the link and try again.",
),
400,
)
else:
return render_template(
"forms/form_activated.html",
email=form.email,
host=form.host,
user=current_user,
)
示例2: confirm_email
# 需要导入模块: from formspree.forms.models import Form [as 别名]
# 或者: from formspree.forms.models.Form import confirm [as 别名]
def confirm_email(nonce):
'''
Confirmation emails point to this endpoint
It either rejects the confirmation or
flags associated email+host to be confirmed
'''
# get the form for this request
form = Form.confirm(nonce)
if not form:
return render_template('error.html',
title='Not a valid link',
text='Confirmation token not found.<br />Please check the link and try again.'), 400
else:
return render_template('forms/email_confirmed.html', email=form.email, host=form.host)