MCPcopy
hub / github.com/django/django / get_level

Function get_level

django/contrib/messages/api.py:51–59  ·  view source on GitHub ↗

Return the minimum level of messages to be recorded. The default level is the ``MESSAGE_LEVEL`` setting. If this is not found, use the ``INFO`` level.

(request)

Source from the content-addressed store, hash-verified

49
50
51def get_level(request):
52 """
53 Return the minimum level of messages to be recorded.
54
55 The default level is the ``MESSAGE_LEVEL`` setting. If this is not found,
56 use the ``INFO`` level.
57 """
58 storage = getattr(request, "_messages", default_storage(request))
59 return storage.level
60
61
62def set_level(request, level):

Callers 4

test_default_levelMethod · 0.90
test_low_levelMethod · 0.90
test_high_levelMethod · 0.90
test_settings_levelMethod · 0.90

Calls 1

default_storageFunction · 0.90

Tested by 4

test_default_levelMethod · 0.72
test_low_levelMethod · 0.72
test_high_levelMethod · 0.72
test_settings_levelMethod · 0.72