summary refs log tree commit diff
path: root/synapse/handlers/account_validity.py
diff options
context:
space:
mode:
authorMichael Kaye <1917473+michaelkaye@users.noreply.github.com>2019-08-12 13:26:49 +0100
committerGitHub <noreply@github.com>2019-08-12 13:26:49 +0100
commit62f5e3bc4c09ad9bfa6bf9cb524ce9e6398663a5 (patch)
treea4cbd621d7be5801f6a5e8fbcdf14b20b5995bf2 /synapse/handlers/account_validity.py
parentMerge pull request #5781 from matrix-org/baboliver/loopingcall-args (diff)
parentLint (diff)
downloadsynapse-62f5e3bc4c09ad9bfa6bf9cb524ce9e6398663a5.tar.xz
Merge pull request #5812 from matrix-org/babolivier/account-validity-messages dinsic_2019-08-12
Account validity: allow defining HTML templates to serve the user on account renewal attempt
Diffstat (limited to '')
-rw-r--r--synapse/handlers/account_validity.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/synapse/handlers/account_validity.py b/synapse/handlers/account_validity.py

index 5e0b92eb1c..396f0059f7 100644 --- a/synapse/handlers/account_validity.py +++ b/synapse/handlers/account_validity.py
@@ -223,11 +223,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