-
-
Notifications
You must be signed in to change notification settings - Fork 3
Don't push if an user account has expired #58
Conversation
91bfee4
to
d05a48a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer if you could factor out the code into a single function that's called in both places, but otherwise lgtm.
184f9cd
to
88bef9c
Compare
88bef9c
to
5263d42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small point about cleanup, otherwise the logic looks sound :)
synapse/handlers/account_validity.py
Outdated
|
||
|
||
@defer.inlineCallbacks | ||
def is_account_expired(user_id: str, store, current_ts: int): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally try not to pass the store
around between functions, but instead always reference it from the homeserver object.
However, I think it would make more sense if this method were moved next to get_expiration_ts_for_user
in synapse/storage/data_stores/main/registration.py
. Then you could simply do yield store.is_account_expired(...)
, rather than having to import is_account_expired
everywhere you want to use it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM assuming CI passes!
…oa/freeze_rooms * 'dinsic' of github.com:matrix-org/synapse-dinsic: Only assert valid next_link params when provided (#65) Don't push if an user account has expired (#58) Swap method calls in RoomAccessTestCase.test_change_rules (#64) Make all rooms noisy by default (#60) Make AccessRules use the public rooms directory instead of checking a room's join rules on rule change (#63) Override the power levels defaults, enforce mod requirement for invites, admin requirements for unknown state events (#61) RoomAccessRules cleanup (#62) Add a config option for validating 'next_link' parameters against a domain whitelist (#8275)
No description provided.