fix: loaddata

This commit is contained in:
Markos Gogoulos
2026-05-25 18:30:44 +03:00
parent a3fe375a83
commit f40f762800
+1 -2
View File
@@ -6,8 +6,7 @@ ADMIN_PASSWORD=${ADMIN_PASSWORD:-$RANDOM_ADMIN_PASS}
if [ X"$ENABLE_MIGRATIONS" = X"yes" ]; then
echo "Running migrations service"
python manage.py migrate
EXISTING_INSTALLATION=`echo "from users.models import User; print(User.objects.exists())" |python manage.py shell 2>/dev/null | tail -1`
if [ "$EXISTING_INSTALLATION" = "True" ]; then
if DJANGO_SETTINGS_MODULE=cms.settings python -c "import django, sys; django.setup(); from users.models import User; sys.exit(0 if User.objects.exists() else 1)" 2>/dev/null; then
echo "Loaddata has already run"
else
echo "Running loaddata and creating admin user"