Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Commit

Permalink
Fix android user creation during init
Browse files Browse the repository at this point in the history
Init was crashing with error:

    django.db.utils.IntegrityError: (1062, "Duplicate entry 'android' for key 'client_id'")

See
https://discuss.overhang.io/t/reset-password-email-sent-but-activation-email-dont/690/4
  • Loading branch information
regisb committed Jun 23, 2020
1 parent b328e0f commit f28ecca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥".

## Unreleased

- [Bugfix] Fix android user creation during init
- [Bugfix] Fix undefined settings in k8s scripts, such as `createuser`

## v10.0.7 (2020-06-22)
Expand Down
4 changes: 4 additions & 0 deletions tutor/templates/hooks/lms/init
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ echo "Loading settings $DJANGO_SETTINGS_MODULE"

./manage.py lms migrate

# Delete obsolete credentials for Android application
./manage.py lms shell -c 'from oauth2_provider.models import get_application_model
get_application_model().objects.filter(name="android").exclude(user__username="login_service_user").delete()'
# Create oauth credentials for Android application
./manage.py lms create_dot_application \
--client-id android \
--client-secret {{ ANDROID_OAUTH2_SECRET }} \
--grant-type password \
--public \
--update \
android \
login_service_user

Expand Down

0 comments on commit f28ecca

Please sign in to comment.