mirror of
https://gh.llkk.cc/https://github.com/WeblateOrg/scripts.git
synced 2025-10-03 15:01:00 +08:00
fix: work with current Django
This commit is contained in:
parent
35e15414d8
commit
95ae9e9e59
1 changed files with 2 additions and 2 deletions
|
@ -20,9 +20,9 @@ if [ -z "$KEY" ]; then
|
|||
echo "Generating new key"
|
||||
if [ -f "/home/weblate/weblate/docker-compose.override.yml" ]; then
|
||||
cd /home/weblate/weblate || exit 1
|
||||
KEY="$(sudo -u weblate docker compose exec --user weblate weblate weblate shell -c 'from weblate.auth.models import User; user = User.objects.create(username="monitor"); print(user.auth_token.key)')"
|
||||
KEY="$(sudo -u weblate docker compose exec --user weblate weblate weblate shell --no-imports -c 'from weblate.auth.models import User; user = User.objects.get_or_create(username="monitor")[0]; print(user.auth_token.key)')"
|
||||
else
|
||||
KEY="$(sudo -u weblate /home/weblate/weblate-env/bin/weblate shell -c 'from weblate.auth.models import User; user = User.objects.create(username="monitor"); print(user.auth_token.key)')"
|
||||
KEY="$(sudo -u weblate /home/weblate/weblate-env/bin/weblate shell --no-imports -c 'from weblate.auth.models import User; user = User.objects.get_or_create(username="monitor")[0]; print(user.auth_token.key)')"
|
||||
fi
|
||||
|
||||
sed -i "s/^env.KEY .*/env.KEY $KEY/" /etc/munin/plugin-conf.d/weblate_servers
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue