-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[WEB-5890]chore: User table migrations #8503
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
base: preview
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughA new BooleanField Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
apps/api/plane/db/models/user.py (1)
87-87: LGTM! Field placement and definition are appropriate.The new
is_password_reset_requiredfield is correctly positioned with other boolean flags and follows existing naming conventions. The default ofFalseis sensible for a new security feature.📝 Optional: Consider adding help_text for better documentation
- is_password_reset_required = models.BooleanField(default=False) + is_password_reset_required = models.BooleanField( + default=False, + help_text="Indicates if the user must reset their password on next login" + )
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
apps/api/plane/db/migrations/0116_user_is_password_reset_required.pyapps/api/plane/db/models/user.py
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: dheeru0198
Repo: makeplane/plane PR: 8339
File: apps/api/plane/db/migrations/0113_webhook_version.py:7-14
Timestamp: 2025-12-29T08:58:46.563Z
Learning: In the Plane codebase, when adding product tour or onboarding fields via migrations, it's intentional to set existing records to `True` (completed) while having the model default to `False` for new records. This ensures existing users don't see tours they don't need.
📚 Learning: 2025-12-29T08:58:46.563Z
Learnt from: dheeru0198
Repo: makeplane/plane PR: 8339
File: apps/api/plane/db/migrations/0113_webhook_version.py:7-14
Timestamp: 2025-12-29T08:58:46.563Z
Learning: In the Plane codebase, when adding product tour or onboarding fields via migrations, it's intentional to set existing records to `True` (completed) while having the model default to `False` for new records. This ensures existing users don't see tours they don't need.
Applied to files:
apps/api/plane/db/migrations/0116_user_is_password_reset_required.py
📚 Learning: 2025-12-23T14:18:32.899Z
Learnt from: dheeru0198
Repo: makeplane/plane PR: 8339
File: apps/api/plane/db/models/api.py:35-35
Timestamp: 2025-12-23T14:18:32.899Z
Learning: Django REST Framework rate limit strings are flexible: only the first character of the time unit matters. Acceptable formats include: "60/s", "60/sec", "60/second" (all equivalent), "60/m", "60/min", "60/minute" (all equivalent), "60/h", "60/hr", "60/hour" (all equivalent), and "60/d", "60/day" (all equivalent). Abbreviations like "min" are valid and do not need to be changed to "minute". Apply this guidance to any Python files in the project that configure DRF throttling rules.
Applied to files:
apps/api/plane/db/migrations/0116_user_is_password_reset_required.pyapps/api/plane/db/models/user.py
🧬 Code graph analysis (2)
apps/api/plane/db/migrations/0116_user_is_password_reset_required.py (1)
apps/api/plane/utils/exporters/schemas/base.py (1)
BooleanField(97-105)
apps/api/plane/db/models/user.py (1)
apps/api/plane/utils/exporters/schemas/base.py (1)
BooleanField(97-105)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: check:types
- GitHub Check: check:lint
- GitHub Check: Analyze (javascript)
🔇 Additional comments (2)
apps/api/plane/db/migrations/0116_user_is_password_reset_required.py (1)
12-17: LGTM! Migration structure is correct.The migration properly adds the
is_password_reset_requiredfield with a sensible default ofFalse, ensuring existing users won't be immediately forced to reset passwords.apps/api/plane/db/models/user.py (1)
87-87: Enforcement logic for password reset flag is missing.The
is_password_reset_requiredfield is added to the User model but has no corresponding implementation to enforce password resets. A similar fieldis_password_autosetis actively checked during authentication (apps/api/plane/authentication/views/common.py); the new field should follow the same pattern in login/authentication views or middleware to block access until a password reset is completed.
Description
This update adds a new key
is_password_reset_requiredto theUsertable.This is key is to be used when user needs to be forced to change the password after login.
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.