Fixed the is_in_section template filter to deal with when the request is not None but the resolver_match is None in the accounting application.
This commit is contained in:
parent
b266a02634
commit
f2455bb946
@ -209,6 +209,8 @@ def is_in_section(request: HttpRequest, section_name: str) -> bool:
|
|||||||
"""
|
"""
|
||||||
if request is None:
|
if request is None:
|
||||||
return False
|
return False
|
||||||
|
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