Fixed the is_in_section filter to return False when there is no request object in the Mia core application.

This commit is contained in:
依瑪貓 2020-08-11 23:39:53 +08:00
parent 28ee42792d
commit 71b4ee5184

View File

@ -206,7 +206,7 @@ def is_in_section(request, section_name):
bool: True if the request is currently in this section, or False
otherwise
"""
if request.resolver_match is None:
if request is None:
return False
view_name = request.resolver_match.view_name
return view_name == section_name\