Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 8079135f8f
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (18 sloc) 0.714 kB
from django.conf import settings
from django.http import HttpResponse, Http404, HttpResponseNotAllowed
from reminders.models import Dismissal
def dismiss(request, label):
if request.method != "POST":
return HttpResponseNotAllowed(["POST"])
if label not in settings.REMINDERS:
return Http404()
dismiss_type = settings.REMINDERS[label].get("dismissable", "session")
if dismiss_type == "session":
request.session[label] = "dismissed"
status = 200
elif dismiss_type == "permanent":
Dismissal.objects.create(user=request.user, label=label)
status = 200
else:
status = 409
return HttpResponse(status=status)
Jump to Line
Something went wrong with that request. Please try again.