Пример #1
0
def send_signal(request, pk):
    error = Error.get(pk)
    if not error.create_signal_sent:
        error.create_signal_sent = True
        error.save()
        error_created.send(sender=error.__class__, instance=error)
        return render_plain("Signal sent")
    return render_plain("Signal not sent")
Пример #2
0
def error_public_toggle(request, pk):
    error = Error.get(pk)
    if request.method.lower() == "post":
        if error.public:
            error.public = False
        else:
            error.public = True
        error.save()
    return HttpResponseRedirect(reverse("error-view", args=[error.id,]))
Пример #3
0
def error_view(request, pk):
    error = Error.get(pk)
    if not error.public:
        if not request.user.is_staff:
            return not_allowed(request)

    if not error.read:
        error.read = True
        error.save()

    return direct_to_template(request, "view.html", extra_context={
        "error":error,
        "nav": {"selected": "list"},
        })
Пример #4
0
def error_view(request, id):
    error = Error.get(id)
    if not error.read:
        error.read = True
        error.save()
    return direct_to_template(request, "view.html", extra_context={"error":error})
Пример #5
0
def error_view(request, pk):
    error = Error.get(pk)
    if not error.read:
        error.read = True
        error.save()
    return direct_to_template(request, "view.html", extra_context={"error": error, "nav": {"selected": "list"}})