MCPcopy
hub / github.com/django/django / add

Function add

tests/messages_tests/urls.py:26–35  ·  view source on GitHub ↗
(request, message_type)

Source from the content-addressed store, hash-verified

24
25@never_cache
26def add(request, message_type):
27 # Don't default to False here to test that it defaults to False if
28 # unspecified.
29 fail_silently = request.POST.get("fail_silently", None)
30 for msg in request.POST.getlist("messages"):
31 if fail_silently is not None:
32 getattr(messages, message_type)(request, msg, fail_silently=fail_silently)
33 else:
34 getattr(messages, message_type)(request, msg)
35 return HttpResponseRedirect(reverse("show_message"))
36
37
38@never_cache

Callers

nothing calls this directly

Calls 4

reverseFunction · 0.90
getMethod · 0.45
getlistMethod · 0.45

Tested by

no test coverage detected