minor: Ask for recipient_id, not recipient.

This commit is contained in:
Steve Howell
2020-10-16 15:02:33 +00:00
committed by Tim Abbott
parent 378062cc83
commit 65dbee4837
2 changed files with 3 additions and 3 deletions

View File

@@ -95,11 +95,11 @@ def save_message_for_edit_use_case(message: Message) -> None:
def user_message_exists_for_topic(user_profile: UserProfile, def user_message_exists_for_topic(user_profile: UserProfile,
recipient: Recipient, recipient_id: int,
topic_name: str) -> bool: topic_name: str) -> bool:
return UserMessage.objects.filter( return UserMessage.objects.filter(
user_profile=user_profile, user_profile=user_profile,
message__recipient=recipient, message__recipient_id=recipient_id,
message__subject__iexact=topic_name, message__subject__iexact=topic_name,
).exists() ).exists()

View File

@@ -71,7 +71,7 @@ def mark_topic_as_read(request: HttpRequest,
if topic_name: if topic_name:
topic_exists = user_message_exists_for_topic( topic_exists = user_message_exists_for_topic(
user_profile=user_profile, user_profile=user_profile,
recipient=recipient, recipient_id=stream.recipient_id,
topic_name=topic_name, topic_name=topic_name,
) )