All checks were successful
Assistant: codex Assistant-Model: gpt-6-astra Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
12 lines
398 B
Python
12 lines
398 B
Python
import re
|
|
|
|
from django.core.exceptions import ImproperlyConfigured
|
|
|
|
|
|
def application_path(value):
|
|
"""A deployment-owned tenant path, never a value taken from request headers."""
|
|
if value in ('', '/'):
|
|
return ''
|
|
if not re.fullmatch(r'/[a-z0-9]+(?:-[a-z0-9]+)*', value):
|
|
raise ImproperlyConfigured('APP_BASE_PATH must be empty or /lowercase-tenant-slug')
|
|
return value
|