# Modify users created an incorrect email and that might clash with the newly created users
./manage.py lms shell -c \
  "from django.contrib.auth import get_user_model;\
  get_user_model().objects.filter(username='notes').exclude(email='notes@openedx').update(email='notes@openedx')"

./manage.py lms manage_user notes notes@openedx --staff --superuser
./manage.py lms create_dot_application \
    notes \
    notes \
    --redirect-uris "http://notes:8000" \
    --client-id {{ NOTES_OAUTH2_KEY }} \
    --client-secret "{{ NOTES_OAUTH2_SECRET }}"

./manage.py lms create_oauth2_client \
    "{% if ACTIVATE_HTTPS %}https{% else %}http{% endif %}://{{ NOTES_HOST }}" \
    "{% if ACTIVATE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}" \
    confidential \
    --client_name edx-notes \
    --client_id {{ NOTES_OAUTH2_KEY }} \
    --client_secret {{ NOTES_OAUTH2_SECRET }} \
    --username notes \
    --trusted