diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2019-07-31 18:12:04 +0200 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2019-08-01 11:59:27 +0200 |
commit | a4a9ded4d002d7edc6d6f46cc5ddcf279a0d7e9b (patch) | |
tree | 271e0ca059a84b6d30b915a57d8bc7233d829e68 /synapse/handlers/account_validity.py | |
parent | Merge pull request #5792 from matrix-org/erikj/fix_bg_update (diff) | |
download | synapse-a4a9ded4d002d7edc6d6f46cc5ddcf279a0d7e9b.tar.xz |
Allow defining HTML templates to serve the user on account renewal
Diffstat (limited to 'synapse/handlers/account_validity.py')
-rw-r--r-- | synapse/handlers/account_validity.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/handlers/account_validity.py b/synapse/handlers/account_validity.py index 930204e2d0..34574f1a12 100644 --- a/synapse/handlers/account_validity.py +++ b/synapse/handlers/account_validity.py @@ -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 |