Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

fix(initsuperuser): remove redundant save and modernize style#5684

Open
yashhzd wants to merge 2 commits intoOWASP-BLT:mainfrom
yashhzd:fix/initsuperuser-redundant-save
Open

fix(initsuperuser): remove redundant save and modernize style#5684
yashhzd wants to merge 2 commits intoOWASP-BLT:mainfrom
yashhzd:fix/initsuperuser-redundant-save

Conversation

@yashhzd
Copy link
Contributor

@yashhzd yashhzd commented Feb 12, 2026

Summary\n\nCleans up the initsuperuser management command:\n\n- Redundant .save(): User.objects.create_superuser() already saves to the database, so the subsequent superuser.save() was an unnecessary extra query.\n- Old-style formatting: Replaced % string formatting with f-strings.\n- Variable naming: Changed USERNAME, EMAIL, PASSWORD (SCREAMING_CASE suggests constants) to lowercase since these are local loop variables.\n\n## Test Plan\n- [ ] python manage.py initsuperuser creates superusers correctly in DEBUG mode\n- [ ] No duplicate save queries in database logs"

- Remove redundant superuser.save() — create_superuser() already
  persists the user to the database
- Replace %-formatting with f-string for consistency
- Use lowercase variable names instead of SCREAMING_CASE for locals
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 12, 2026

Warning

Rate limit exceeded

@yashhzd has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 25 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

👋 Hi @yashhzd!

This pull request needs a peer review before it can be merged. Please request a review from a team member who is not:

  • The PR author
  • DonnieBLT
  • coderabbitai
  • copilot

Once a valid peer review is submitted, this check will pass automatically. Thank you!

@github-actions github-actions bot added the needs-peer-review PR needs peer review label Feb 12, 2026
@github-actions
Copy link
Contributor

📊 Monthly Leaderboard

Hi @yashhzd! Here's how you rank for February 2026:

Rank User Open PRs PRs (merged) PRs (closed) Reviews Comments CR chats Total
#5 @S3DFX-CYBER 4 3 5 3 22 71 83
#6 @yashhzd 38 2 0 0 7 0 72
#7 @Nachiket-Roy 7 3 1 2 12 31 69

Scoring this month: Open PRs (+1 each), Merged PRs (+10), Closed (not merged) (−2), Reviews (+5; first two per PR in-month), Comments (+2, excludes CR). Coderabbit chats column is visible. Points per chat: 0; daily cap per user (UTC): 7.

@github-actions github-actions bot added the pre-commit: passed Pre-commit checks passed label Feb 12, 2026
Copy link
Contributor

@Jayant2908 Jayant2908 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@github-actions github-actions bot added tests: failed Django tests failed last-active: 0d PR last updated 0 days ago labels Feb 12, 2026
@github-actions github-actions bot added has-peer-review PR has received peer review tests: P:324 F:0 S:0 Django tests passed and removed last-active: 0d PR last updated 0 days ago needs-peer-review PR needs peer review tests: failed Django tests failed labels Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

files-changed: 1 has-peer-review PR has received peer review pre-commit: passed Pre-commit checks passed tests: P:324 F:0 S:0 Django tests passed

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants