Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Jul 3, 2024
1 parent 1853d94 commit d0814ec
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions qwc_services_core/tenant_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ def __call__(self, environ, start_response):
):
# add tenant path prefix for multitenancy
# NOTE: skipped if tenant already in path when using TENANT_URL_RE
prefix = os.environ.get('TENANT_PATH_PREFIX', '@service_prefix@/@tenant@').replace('@service_prefix@', self.service_prefix).replace('@tenant@', tenant)
prefix = os.environ.get(
'TENANT_PATH_PREFIX', '@service_prefix@/@tenant@'
).replace(
'@service_prefix@', self.service_prefix
).replace('@tenant@', tenant)
environ['SCRIPT_NAME'] = prefix + environ.get(
'SCRIPT_NAME', '')
return self.app(environ, start_response)
Expand All @@ -200,7 +204,11 @@ def __init__(self, environ):
def tenant_path_prefix(self):
"""Tenant path prefix /map/org1 ("$QWC_SERVICE_PREFIX/$TENANT")"""
if self.is_multi():
return os.environ.get('TENANT_PATH_PREFIX', '@service_prefix@/@tenant@').replace('@service_prefix@', self.service_prefix).replace('@tenant@', self.tenant())
return os.environ.get(
'TENANT_PATH_PREFIX', '@service_prefix@/@tenant@'
).replace(
'@service_prefix@', self.service_prefix
).replace('@tenant@', self.tenant())
else:
return self.service_prefix + "/"

Expand Down

0 comments on commit d0814ec

Please sign in to comment.