Skip to content

Conversation

@vitali-yanushchyk-valor
Copy link
Contributor

@vitali-yanushchyk-valor vitali-yanushchyk-valor commented Jan 6, 2026

  • Add environment variable SUPERUSERS.
  • Builds a deduplicated, ordered list of superuser identities from env ADMIN_EMAIL (or --admin-email) plus env SUPERUSERS (or --superusers, space-separated).
  • Each identity is treated as either an email (contains @) or a username; for usernames, a fallback email is derived as "{username}@{FALLBACK_EMAIL_DOMAIN}".
  • Lookup semantics are split:
    • If identity is an email, it first searches by email (canonical), then by username == identity.
    • If identity is a username, it searches only by username (email is not used for lookup).
  • If a user exists, it ensures is_staff=True and is_superuser=True (updates only when needed).
  • If the user does not exist, it validates the email and creates the account via Django’s createsuperuser; password is only provided for ADMIN_EMAIL when ADMIN_PASSWORD is set. Otherwise creates the account with an unusable password.

AB#291835

@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.45%. Comparing base (f2028eb) to head (cd2d592).
⚠️ Report is 4 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #252      +/-   ##
===========================================
+ Coverage    96.31%   96.45%   +0.13%     
===========================================
  Files           82       82              
  Lines         1955     1974      +19     
  Branches       117      118       +1     
===========================================
+ Hits          1883     1904      +21     
+ Misses          53       52       -1     
+ Partials        19       18       -1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vitali-yanushchyk-valor vitali-yanushchyk-valor merged commit 0a6124c into develop Jan 8, 2026
18 checks passed
@vitali-yanushchyk-valor vitali-yanushchyk-valor deleted the feature/291835-when-running-upgrade-command-take-the-list-of-superusers branch January 8, 2026 09:16
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