Skip to content

Commit

Permalink
Fix: Add support for new version of django-allauth (#655)
Browse files Browse the repository at this point in the history
* Fix: Add support for new version of django-allauth

* Use full path for manage.py script
  • Loading branch information
maxking authored Oct 2, 2023
1 parent f45adbf commit 022cb48
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions postorius/mailman-web/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'django_mailman3.middleware.TimezoneMiddleware',
'allauth.account.middleware.AccountMiddleware',
'postorius.middleware.PostoriusMiddleware',
)

Expand Down
8 changes: 4 additions & 4 deletions web/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,20 @@ echo "Compiling locale files in $SITE_DIR"
cd $SITE_DIR && /opt/mailman-web/manage.py compilemessages && cd -

# Compress static files.
python3 manage.py compress --force
python3 /opt/mailman-web/manage.py compress --force


# Migrate all the data to the database if this is a new installation, otherwise
# this command will upgrade the database.
python3 manage.py migrate
python3 /opt/mailman-web/manage.py migrate

# If MAILMAN_ADMIN_USER and MAILMAN_ADMIN_EMAIL is defined create a new
# superuser for Django. There is no password setup so it can't login yet unless
# the password is reset.
if [[ -v MAILMAN_ADMIN_USER ]] && [[ -v MAILMAN_ADMIN_EMAIL ]];
then
echo "Creating admin user $MAILMAN_ADMIN_USER ..."
python3 manage.py createsuperuser --noinput --username "$MAILMAN_ADMIN_USER"\
python3 /opt/mailman-web/manage.py createsuperuser --noinput --username "$MAILMAN_ADMIN_USER"\
--email "$MAILMAN_ADMIN_EMAIL" 2> /dev/null || \
echo "Superuser $MAILMAN_ADMIN_USER already exists"
fi
Expand All @@ -141,7 +141,7 @@ fi
if [[ -v SERVE_FROM_DOMAIN ]];
then
echo "Setting $SERVE_FROM_DOMAIN as the default domain ..."
python3 manage.py shell -c \
python3 /opt/mailman-web/manage.py shell -c \
"from django.contrib.sites.models import Site; Site.objects.filter(domain='example.com').update(domain='$SERVE_FROM_DOMAIN', name='$SERVE_FROM_DOMAIN')"
fi

Expand Down
1 change: 1 addition & 0 deletions web/mailman-web/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'allauth.account.middleware.AccountMiddleware',
'django_mailman3.middleware.TimezoneMiddleware',
'postorius.middleware.PostoriusMiddleware',
)
Expand Down

0 comments on commit 022cb48

Please sign in to comment.