Read read flags from UserMessage not Message

(imported from commit 4c0f6ec90992c61ba861f5f347655673e769bebc)
This commit is contained in:
Leo Franchi 2013-12-06 15:08:02 -05:00
parent da81bcae0e
commit 4f2cb1bc1c
1 changed files with 3 additions and 2 deletions

View File

@ -2012,9 +2012,10 @@ def do_send_missedmessage_events(user_profile, missed_messages):
@statsd_increment("push_notifications")
def handle_push_notification(user_profile_id, missed_message):
user_profile = get_user_profile_by_id(user_profile_id)
message = UserMessage.objects.get(user_profile=user_profile,
umessage = UserMessage.objects.get(user_profile=user_profile,
message__id=missed_message['message_id']).message
if message.flags.read:
message = umessage.message
if umessage.flags.read:
return
sender_str = message.sender.full_name