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")
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,]))
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"}, })
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})
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"}})