def get_config(context): request = context["request"] url_name = None if getattr(request, "resolver_match", None): # This does not exist when testing views directly url_name = request.resolver_match.url_name qs = {"context": url_name} return { "searchUrl": manipulate_query_string(reverse("shuup_admin:search"), **qs), "menuUrl": manipulate_query_string(reverse("shuup_admin:menu"), **qs), "browserUrls": get_browser_urls(), "csrf": get_token(request), "docsPage": settings.SHUUP_ADMIN_MERCHANT_DOCS_PAGE, "menuOpen": is_menu_open(request) }
def get_config(context): request = context["request"] url_name = None if getattr(request, "resolver_match", None): # This does not exist when testing views directly url_name = request.resolver_match.url_name qs = {"context": url_name} return { "searchUrl": manipulate_query_string(reverse("shuup_admin:search"), **qs), "menuUrl": manipulate_query_string(reverse("shuup_admin:menu"), **qs), "browserUrls": get_browser_urls(request), "csrf": get_token(request), "docsPage": settings.SHUUP_ADMIN_MERCHANT_DOCS_PAGE, "menuOpen": is_menu_open(request), "settings": get_settings(request) }