Merge pull request #961 from MarcHagen/patch-1

Catch DoesNotExist preventing startup
This commit is contained in:
Tobias Genannt 2023-03-16 07:37:05 +01:00 committed by GitHub
commit 256f23b4ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,9 +84,12 @@ fi
./manage.py shell --interface python <<END ./manage.py shell --interface python <<END
from users.models import Token from users.models import Token
old_default_token = Token.objects.get(key="0123456789abcdef0123456789abcdef01234567") try:
if old_default_token: old_default_token = Token.objects.get(key="0123456789abcdef0123456789abcdef01234567")
if old_default_token:
print("⚠️ Warning: You have the old default admin token in your database. This token is widely known; please remove it.") print("⚠️ Warning: You have the old default admin token in your database. This token is widely known; please remove it.")
except Token.DoesNotExist:
pass
END END
echo "✅ Initialisation is done." echo "✅ Initialisation is done."