Skip to content

Commit

Permalink
Make tenant_path_prefix consistent by enforcing a slash at the end. (#13
Browse files Browse the repository at this point in the history
)

Co-authored-by: Quentin Wenger <[email protected]>
  • Loading branch information
qwenger and Quentin Wenger authored Sep 5, 2024
1 parent b126b3d commit 0f08ba9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions qwc_services_core/tenant_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,15 @@ def __init__(self, environ):
'QWC_SERVICE_PREFIX', '').rstrip('/')

def tenant_path_prefix(self):
"""Tenant path prefix /map/org1 ("$QWC_SERVICE_PREFIX/$TENANT")"""
"""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())
).replace(
'@tenant@', self.tenant()
).rstrip('/') + '/'
else:
return self.service_prefix + "/"

Expand Down

0 comments on commit 0f08ba9

Please sign in to comment.