Example #1
0
File: views.py Project: jdm/kitsune
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
Example #2
0
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
Example #3
0
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
Example #4
0
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