Fixed the is_in_section filter to return False when the resolver does not match at all in the Mia core application.
This commit is contained in:
parent
990a5686d9
commit
3a32e00121
@ -206,6 +206,8 @@ def is_in_section(request, section_name):
|
|||||||
bool: True if the request is currently in this section, or False
|
bool: True if the request is currently in this section, or False
|
||||||
otherwise
|
otherwise
|
||||||
"""
|
"""
|
||||||
|
if request.resolver_match is None:
|
||||||
|
return False
|
||||||
view_name = request.resolver_match.view_name
|
view_name = request.resolver_match.view_name
|
||||||
return view_name == section_name\
|
return view_name == section_name\
|
||||||
or view_name.startswith(section_name + ".")
|
or view_name.startswith(section_name + ".")
|
||||||
|
Loading…
Reference in New Issue
Block a user