Override admin path in cli with env param

This commit is contained in:
Holger Sielaff
2025-08-04 17:07:26 +02:00
parent 79c68169f6
commit 95689efbbf
11 changed files with 108 additions and 9 deletions

View File

@@ -75,7 +75,7 @@ class TranslatableMixin:
# Check if we're in admin context by looking at the call stack
frames = inspect.getouterframes(inspect.currentframe())
is_admin_context = any('admin' in frame.filename or 'forms' in frame.filename for frame in frames[:5])
is_admin_context = os.environ.get('DJANGO_ADMIN_OVERRIDE', False) == '1' or any('admin' in frame.filename or 'forms' in frame.filename for frame in frames[:5])
logging.debug(f"{self.__class__.__name__} from_db_value - admin context: {is_admin_context}")