fix: prestart.sh loaddata re-runs on every container restart (#1502)

This commit is contained in:
Ayana Oide
2026-05-19 13:34:39 -05:00
committed by GitHub
parent e89c4a3c85
commit 777b06bbeb
+1 -1
View File
@@ -6,7 +6,7 @@ ADMIN_PASSWORD=${ADMIN_PASSWORD:-$RANDOM_ADMIN_PASS}
if [ X"$ENABLE_MIGRATIONS" = X"yes" ]; then if [ X"$ENABLE_MIGRATIONS" = X"yes" ]; then
echo "Running migrations service" echo "Running migrations service"
python manage.py migrate python manage.py migrate
EXISTING_INSTALLATION=`echo "from users.models import User; print(User.objects.exists())" |python manage.py shell` 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 [ "$EXISTING_INSTALLATION" = "True" ]; then
echo "Loaddata has already run" echo "Loaddata has already run"
else else