Ejemplo n.º 1
0
Archivo: views.py Proyecto: 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
Ejemplo n.º 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
Ejemplo n.º 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
Ejemplo n.º 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