mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
event_schema: Add schema check for realm/deactivated event.
This add the schema checker, openapi schema, and also a test for realm/deactivated event. With several block comments by tabbott explaining the logic behind our behavior here. Part of #17568.
This commit is contained in:
@@ -742,6 +742,15 @@ def apply_event(
|
||||
if key == "authentication_methods":
|
||||
state["realm_password_auth_enabled"] = value["Email"] or value["LDAP"]
|
||||
state["realm_email_auth_enabled"] = value["Email"]
|
||||
elif event["op"] == "deactivated":
|
||||
# The realm has just been deactivated. If our request had
|
||||
# arrived a moment later, we'd have rendered the
|
||||
# deactivation UI; if it'd been a moment sooner, we've
|
||||
# have rendered the app and then immediately got this
|
||||
# event (or actually, more likely, an auth error on GET
|
||||
# /events) and immediately reloaded into the same
|
||||
# deactivation UI. Passing achieves the same result.
|
||||
pass
|
||||
else:
|
||||
raise AssertionError("Unexpected event type {type}/{op}".format(**event))
|
||||
elif event["type"] == "subscription":
|
||||
|
||||
Reference in New Issue
Block a user