def read(request, template, msgid): message = get_object_or_404(InboxMessage, pk=msgid, to=request.user) was_new = message.unread if was_new: message.update(read=True) initial = {"to": message.sender, "in_reply_to": message.pk} form = ReplyForm(initial=initial) response = render(request, template, {"message": message, "form": form}) if was_new: response = mark_as_write(response) return response
def read(request, template, msgid): message = get_object_or_404(InboxMessage, pk=msgid, to=request.user) was_new = message.unread if was_new: message.update(read=True) initial = {'to': message.sender, 'in_reply_to': message.pk} form = ReplyForm(initial=initial) response = render(request, template, {'message': message, 'form': form}) if was_new: response = mark_as_write(response) return response
def read(request, msgid): message = get_object_or_404(InboxMessage, pk=msgid, to=request.user) was_new = message.unread if was_new: message.update(read=True) initial = {'to': message.sender, 'in_reply_to': message.pk} form = ReplyForm(initial=initial) response = jingo.render(request, 'messages/read.html', {'message': message, 'form': form}) if was_new: response = mark_as_write(response) return response
def read(request, msgid): message = get_object_or_404(InboxMessage, pk=msgid, to=request.user) was_new = message.unread if was_new: message.update(read=True) initial = {"to": message.sender, "in_reply_to": message.pk} form = ReplyForm(initial=initial) response = render(request, "messages/read.html", { "message": message, "form": form }) if was_new: response = mark_as_write(response) return response