-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feat/946/default admin #964
base: master
Are you sure you want to change the base?
Conversation
# Conflicts: # app/api/entrypoint.sh
i added docstrings and removed a "hello worl" #946 https://github.com/orgs/Health-Informatics-UoN/projects/13?pane=issue&itemId=98223538&issue=Health-Informatics-UoN%7Ccarrot-mapper%7C946
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Peter,
The code looks great! I just have a small suggestion and let me know your thoughts.
Looking forward from you.
Thanks and regards,
Karthik
app/shared/shared/mapping/management/commands/default_super_user.py
Outdated
Show resolved
Hide resolved
app/shared/shared/mapping/management/commands/default_super_user.py
Outdated
Show resolved
Hide resolved
app/shared/shared/mapping/management/commands/default_super_user.py
Outdated
Show resolved
Hide resolved
app/shared/shared/mapping/management/commands/default_super_user.py
Outdated
Show resolved
Hide resolved
app/shared/shared/mapping/management/commands/default_super_user.py
Outdated
Show resolved
Hide resolved
…er.py Co-authored-by: Tri Thien Nguyen <[email protected]>
…er.py Co-authored-by: Tri Thien Nguyen <[email protected]>
…er.py Co-authored-by: Tri Thien Nguyen <[email protected]>
adjusted the log messages for "add user" and "don't add user"
the "create default super user" test expectation needed to be updated to account for the new log message which includes the password
Thanks for your changes @g-pechorin. I can approve your PR once I get the request access. |
# log the user's details | ||
self.stdout.write( | ||
self.style.SUCCESS( | ||
f"Superuser successfully created with Username='{self.settings.SUPERUSER_DEFAULT_NAME}', Password='{self.settings.SUPERUSER_DEFAULT_PASSWORD}'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security concerns were raised by @brian-kim31 when password and username are exposed on the console.
Maybe you can hide the password somehow, only showing a few last letters for the purpose of tracking, for example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about first-letter *** last-letter? so with Password123!
it'd show P**********!
?
Pull Request Contents
Description
Adds a management command, is invoked on setup, which creates a default admin user for the carrot system iff there are 0 users in the database at present.
Related Issues or other material
closes #946
Screenshots, example outputs/behaviour etc.
✅ Added/updated tests?
This functionality relies on reading the django database, performing a single comparison - a test seems redundant.