summary refs log tree commit diff
path: root/synapse/handlers/account_validity.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-08-28 18:17:26 +0100
committerBrendan Abolivier <babolivier@matrix.org>2019-08-28 18:17:26 +0100
commite5df12ad1668ba1d75e3d5fdf5fe1cb7d0a43400 (patch)
tree6434740f5f259c420f0863ad50d7a0ff3314d5a9 /synapse/handlers/account_validity.py
parentImplement per-room message retention policies (diff)
parentMerge pull request #5812 from matrix-org/babolivier/account-validity-messages (diff)
downloadsynapse-e5df12ad1668ba1d75e3d5fdf5fe1cb7d0a43400.tar.xz
Merge branch 'dinsic' into babolivier/dinsic-message-retention
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