Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add create django superuser if django superuser username is set #92

Merged
merged 3 commits into from
May 10, 2024

Conversation

BesartSulejmani
Copy link
Contributor

Just like within objects-api we would like to be able to create a superuser for objecttypes-api by specifying environment variables. Without this functionality we need to do it manually after deploying the application.

@alextreme alextreme requested a review from annashamray January 31, 2024 14:57
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8f4a69a) 94.97% compared to head (b615a8b) 94.97%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #92   +/-   ##
=======================================
  Coverage   94.97%   94.97%           
=======================================
  Files          88       88           
  Lines        1890     1890           
=======================================
  Hits         1795     1795           
  Misses         95       95           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BesartSulejmani
Copy link
Contributor Author

I have updated the code because it wasn't fully functional. After the first creation of the superuser, upon restarting the app, you'll get the error "username already exists".

I've compared objecttypes-api with objects-api and it caught my attention that there is a createinitialsuperuser command. I've added this part to objecttypes-api and tested it. Please review the last commit.

@annashamray annashamray merged commit 38e11f9 into maykinmedia:master May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants