fix(initsuperuser): remove redundant save and modernize style#5684
fix(initsuperuser): remove redundant save and modernize style#5684yashhzd wants to merge 2 commits intoOWASP-BLT:mainfrom
Conversation
- 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
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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)
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. Comment |
|
👋 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:
Once a valid peer review is submitted, this check will pass automatically. Thank you! |
📊 Monthly LeaderboardHi @yashhzd! Here's how you rank for February 2026:
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. |
Summary\n\nCleans up the
initsuperusermanagement command:\n\n- Redundant.save():User.objects.create_superuser()already saves to the database, so the subsequentsuperuser.save()was an unnecessary extra query.\n- Old-style formatting: Replaced%string formatting with f-strings.\n- Variable naming: ChangedUSERNAME,EMAIL,PASSWORD(SCREAMING_CASE suggests constants) to lowercase since these are local loop variables.\n\n## Test Plan\n- [ ]python manage.py initsuperusercreates superusers correctly in DEBUG mode\n- [ ] No duplicate save queries in database logs"