1👍
✅
Cache the queryset in a list before marking the messages as read:
newmessages = list(Notification.objects.filter(recipient=User, unread=True))
Source:stackexchange.com