message: Do not pass "sender__realm" to select_related.

We have modified the code to directly fetch realm from Message
object instead of "sender" field and thus we no longer need to
fetch "sender__realm" using select_related.
This commit is contained in:
Sahil Batra
2023-08-23 12:14:02 +05:30
committed by Tim Abbott
parent e9a6f69849
commit 5a8416ff6a
2 changed files with 2 additions and 2 deletions

View File

@@ -598,7 +598,7 @@ class MessageDict:
# of going to the DB here should be overshadowed by the cost of rendering
# and updating the row.
# TODO: see #1379 to eliminate Markdown dependencies
message = Message.objects.select_related("sender", "sender__realm").get(id=message_id)
message = Message.objects.select_related("sender").get(id=message_id)
assert message is not None # Hint for mypy.
# It's unfortunate that we need to have side effects on the message