Update synapse/handlers/admin.py

Co-authored-by: Eric Eastwood <erice@element.io>
This commit is contained in:
Kegan Dougal
2026-03-09 16:40:53 +00:00
committed by GitHub
parent 7311f929ba
commit 85fa59eb5f
+1 -6
View File
@@ -491,12 +491,7 @@ class AdminHandler:
prev_state_events = event.get_dict().get(
"prev_state_events", None
)
if prev_state_events is None:
# should be impossible as prev_state_events is a required field.
raise Exception(
"cannot set prev_state_events for redaction event as parent has "
+ "no prev_state_events",
)
assert prev_state_events is not None, "Parent event of redaction has no `prev_state_events` which should be impossible as `prev_state_events` is a required event in MSC4242 rooms"
# set the prev event to the offending message to allow for redactions
# to be processed in the case where the user has been kicked/banned before
# redactions are requested.