summary refs log tree commit diff
path: root/synapse/handlers/register.py
diff options
context:
space:
mode:
authorlukasdenk <63459921+lukasdenk@users.noreply.github.com>2022-01-17 17:43:25 +0100
committerGitHub <noreply@github.com>2022-01-17 16:43:25 +0000
commitd8be9924efd5905e584cbb320ed4ec1aaa164c62 (patch)
treeb70ddbec9a1f216a0fede30e5c47efc3f894f856 /synapse/handlers/register.py
parentWarn against using Let's Encrypt certs for encrypted TURN (#11686) (diff)
downloadsynapse-d8be9924efd5905e584cbb320ed4ec1aaa164c62.tar.xz
Add a flag to the `synapse_review_recent_signups` script to ignore and filter appservice users. (#11675)
Diffstat (limited to '')
-rw-r--r--synapse/handlers/register.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/synapse/handlers/register.py b/synapse/handlers/register.py
index f08a516a75..68dbae5916 100644
--- a/synapse/handlers/register.py
+++ b/synapse/handlers/register.py
@@ -979,16 +979,18 @@ class RegistrationHandler:
         if (
             self.hs.config.email.email_enable_notifs
             and self.hs.config.email.email_notif_for_new_users
-            and token
         ):
             # Pull the ID of the access token back out of the db
             # It would really make more sense for this to be passed
             # up when the access token is saved, but that's quite an
             # invasive change I'd rather do separately.
-            user_tuple = await self.store.get_user_by_access_token(token)
-            # The token better still exist.
-            assert user_tuple
-            token_id = user_tuple.token_id
+            if token:
+                user_tuple = await self.store.get_user_by_access_token(token)
+                # The token better still exist.
+                assert user_tuple
+                token_id = user_tuple.token_id
+            else:
+                token_id = None
 
             await self.pusher_pool.add_pusher(
                 user_id=user_id,