send_message_backend: Set the realm value passed down to check_message.

This leftover variable, as a result of older changes, was just always
set to None. That was fine, because when realm=None reaches
check_message further down the codepath, it just infers from
sender.realm. We want to stop passing None like that though, so let's
just set this to user_profile.realm.
This commit is contained in:
Mateusz Mandera 2023-02-27 23:54:43 +01:00 committed by Tim Abbott
parent 514e5b990e
commit 82379c31e4
1 changed files with 1 additions and 1 deletions

View File

@ -237,7 +237,7 @@ def send_message_backend(
if forged and not can_forge_sender:
raise JsonableError(_("User not authorized for this query"))
realm = None
realm = user_profile.realm
if realm_str and realm_str != user_profile.realm.string_id:
# The realm_str parameter does nothing, because it has to match
# the user's realm - but we keep it around for backward compatibility.