Terms of use confirmation

This commit is contained in:
Inga Kirschnick
2023-04-13 16:08:07 +02:00
parent 144bb38d75
commit 8538fc705f
10 changed files with 198 additions and 2 deletions

View File

@ -55,3 +55,15 @@ def delete_user_avatar(user_id):
'message': f'Avatar marked for deletion'
}
return response_data, 202
@bp.route('/accept-terms-of-use', methods=['POST'])
@content_negotiation(produces='application/json')
def accept_terms_of_use():
if not (current_user.is_authenticated or current_user.confirmed):
abort(403)
current_user.terms_of_use_accepted = True
db.session.commit()
response_data = {
'message': 'You accepted the terms of use',
}
return response_data, 202