Allow defining HTML templates to serve the user on account renewal

This commit is contained in:
Brendan Abolivier 2019-07-31 18:12:04 +02:00
parent 62a2d60d72
commit a4a9ded4d0
No known key found for this signature in database
GPG key ID: 1E015C145F1916CD
5 changed files with 76 additions and 9 deletions

View file

@ -226,11 +226,19 @@ class AccountValidityHandler(object):
Args:
renewal_token (str): Token sent with the renewal request.
Returns:
bool: Whether the provided token is valid.
"""
user_id = yield self.store.get_user_from_renewal_token(renewal_token)
try:
user_id = yield self.store.get_user_from_renewal_token(renewal_token)
except StoreError:
defer.returnValue(False)
logger.debug("Renewing an account for user %s", user_id)
yield self.renew_account_for_user(user_id)
defer.returnValue(True)
@defer.inlineCallbacks
def renew_account_for_user(self, user_id, expiration_ts=None, email_sent=False):
"""Renews the account attached to a given user by pushing back the