diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ca794215..191ead884 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -150,8 +150,6 @@ jobs: run: | echo "Running checks..." ./ietf/manage.py check - ./ietf/manage.py migrate || true - echo "USE_TZ = True" >> ./ietf/settings_local.py ./ietf/manage.py migrate echo "Validating migrations..." if ! ( ietf/manage.py makemigrations --dry-run --check --verbosity 3 ) ; then diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index d9c5cdc85..e2924ceaa 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -45,10 +45,6 @@ jobs: run: | echo "Running checks..." ./ietf/manage.py check - echo "Running migrations with USE_TZ=False..." - ./ietf/manage.py migrate || true - echo "USE_TZ = True" >> ./ietf/settings_local.py - echo "Running migrations with USE_TZ=True..." ./ietf/manage.py migrate echo "Validating migrations..." if ! ( ietf/manage.py makemigrations --dry-run --check --verbosity 3 ) ; then diff --git a/dev/deploy-to-container/start.sh b/dev/deploy-to-container/start.sh index 03e26d77d..f9359fb60 100644 --- a/dev/deploy-to-container/start.sh +++ b/dev/deploy-to-container/start.sh @@ -11,29 +11,9 @@ echo "Running Datatracker checks..." ./ietf/manage.py check # Migrate, adjusting to what the current state of the underlying database might be: -WORKSPACEDIR=. -if ietf/manage.py showmigrations | grep "\[ \] 0003_pause_to_change_use_tz"; then - if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then - cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = False/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py - else - echo "USE_TZ = False" >> $WORKSPACEDIR/ietf/settings_local.py - fi - echo "Running Datatracker migrations with USE_TZ = False..." - # This is expected to exit non-zero at the pause - /usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local || true - cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py - echo "Running Datatracker migrations with USE_TZ = True..." - /usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local -else - if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then - cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py - else - echo "USE_TZ = True" >> $WORKSPACEDIR/ietf/settings_local.py - echo "Running Datatracker migrations..." - /usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local - fi -fi +echo "Running Datatracker migrations..." +/usr/local/bin/python ./ietf/manage.py migrate --settings=settings_local echo "Starting Datatracker..." ./ietf/manage.py runserver 0.0.0.0:8000 --settings=settings_local diff --git a/dev/diff/prepare.sh b/dev/diff/prepare.sh index 2e80a8e43..ad281c183 100644 --- a/dev/diff/prepare.sh +++ b/dev/diff/prepare.sh @@ -14,22 +14,5 @@ chmod +x ./docker/scripts/app-create-dirs.sh ./docker/scripts/app-create-dirs.sh ./ietf/manage.py check -if ./ietf/manage.py showmigrations | grep "\[ \] 0003_pause_to_change_use_tz"; then - if grep "USE_TZ" ./ietf/settings_local.py; then - cat ./ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = False/' > /tmp/settings_local.py && mv /tmp/settings_local.py ./ietf/settings_local.py - else - echo "USE_TZ = False" >> ./ietf/settings_local.py - fi - # This is expected to exit non-zero at the pause - /usr/local/bin/python ./ietf/manage.py migrate || true - cat ./ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py ./ietf/settings_local.py - /usr/local/bin/python ./ietf/manage.py migrate +./ietf/manage.py migrate -else - if grep "USE_TZ" ./ietf/settings_local.py; then - cat ./ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py ./ietf/settings_local.py - else - echo "USE_TZ = True" >> ./ietf/settings_local.py - /usr/local/bin/python ./ietf/manage.py migrate - fi -fi diff --git a/docker/scripts/app-init.sh b/docker/scripts/app-init.sh index 7557e8f45..6d06bb442 100755 --- a/docker/scripts/app-init.sh +++ b/docker/scripts/app-init.sh @@ -103,25 +103,8 @@ echo "Running initial checks..." # Migrate, adjusting to what the current state of the underlying database might be: -if ietf/manage.py showmigrations | grep "\[ \] 0003_pause_to_change_use_tz"; then - if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then - cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = False/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py - else - echo "USE_TZ = False" >> $WORKSPACEDIR/ietf/settings_local.py - fi - # This is expected to exit non-zero at the pause - /usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local || true - cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py - /usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local +/usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local -else - if grep "USE_TZ" $WORKSPACEDIR/ietf/settings_local.py; then - cat $WORKSPACEDIR/ietf/settings_local.py | sed 's/USE_TZ.*$/USE_TZ = True/' > /tmp/settings_local.py && mv /tmp/settings_local.py $WORKSPACEDIR/ietf/settings_local.py - else - echo "USE_TZ = True" >> $WORKSPACEDIR/ietf/settings_local.py - /usr/local/bin/python $WORKSPACEDIR/ietf/manage.py migrate --settings=settings_local - fi -fi echo "-----------------------------------------------------------------" echo "Done!" diff --git a/ietf/settings.py b/ietf/settings.py index 609cb3877..8c1165cd6 100644 --- a/ietf/settings.py +++ b/ietf/settings.py @@ -114,7 +114,7 @@ SITE_ID = 1 # to load the internationalization machinery. USE_I18N = False -USE_TZ = False +USE_TZ = True if SERVER_MODE == 'production': MEDIA_ROOT = '/a/www/www6s/lib/dt/media/'