Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit d836b37

Browse files
committed
Partially revert #11675; prevent attempting to create pushers on workers
1 parent 7ad7a47 commit d836b37

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

synapse/handlers/register.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -979,18 +979,16 @@ async def _register_email_threepid(
979979
if (
980980
self.hs.config.email.email_enable_notifs
981981
and self.hs.config.email.email_notif_for_new_users
982+
and token
982983
):
983984
# Pull the ID of the access token back out of the db
984985
# It would really make more sense for this to be passed
985986
# up when the access token is saved, but that's quite an
986987
# invasive change I'd rather do separately.
987-
if token:
988-
user_tuple = await self.store.get_user_by_access_token(token)
989-
# The token better still exist.
990-
assert user_tuple
991-
token_id = user_tuple.token_id
992-
else:
993-
token_id = None
988+
user_tuple = await self.store.get_user_by_access_token(token)
989+
# The token better still exist.
990+
assert user_tuple
991+
token_id = user_tuple.token_id
994992

995993
await self.pusher_pool.add_pusher(
996994
user_id=user_id,

0 commit comments

Comments
 (0)