Add e-mail authorization to the repository notification flow. Also validates the creation of the other notification methods.

This commit is contained in:
Joseph Schorr 2014-07-28 14:58:12 -04:00
parent 56fec63fcd
commit 34fc279092
15 changed files with 483 additions and 34 deletions

View file

@ -214,6 +214,26 @@ def receipt():
abort(404)
@web.route('/authrepoemail', methods=['GET'])
def confirm_repo_email():
code = request.values['code']
record = None
try:
record = model.confirm_email_authorization_for_repo(code)
except model.DataModelException as ex:
return render_page_template('confirmerror.html', error_message=ex.message)
message = """
Your E-mail address has been authorized to receive notifications for repository
<a href="%s://%s/repository/%s/%s">%s/%s</a>.
""" % (app.config['PREFERRED_URL_SCHEME'], app.config['SERVER_HOSTNAME'],
record.repository.namespace, record.repository.name,
record.repository.namespace, record.repository.name)
return render_page_template('message.html', message=message)
@web.route('/confirm', methods=['GET'])
def confirm_email():
code = request.values['code']