Skip to content

Conversation

@vamsikrishnamathala
Copy link
Member

@vamsikrishnamathala vamsikrishnamathala commented Jan 8, 2026

Description

This update adds a new key is_password_reset_required to the User table.
This is key is to be used when user needs to be forced to change the password after login.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Test Scenarios

References

Summary by CodeRabbit

  • New Features
    • Password reset status tracking: Users can now see whether a password reset is required for their account to help manage security.
    • Notification view preferences: Two display modes—Full (detailed) and Compact (streamlined)—allow users to choose how notifications are shown.

✏️ Tip: You can customize this high-level summary in your review settings.

@vamsikrishnamathala vamsikrishnamathala self-assigned this Jan 8, 2026
@vamsikrishnamathala vamsikrishnamathala added the 🔄migrations Contains Migration changes label Jan 8, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

📝 Walkthrough

Walkthrough

Added two new database fields: User.is_password_reset_required (Boolean) and Profile.notification_view_mode (Char with FULL/COMPACT choices). A Django migration (0116_profile_notification_view_mode_and_more.py) applies these schema updates.

Changes

Cohort / File(s) Change Summary
Model additions
apps/api/plane/db/models/user.py
Added is_password_reset_required: BooleanField(default=False) on User; added NotificationViewMode TextChoices (FULL, COMPACT); added notification_view_mode: CharField(choices=NotificationViewMode.choices, default=NotificationViewMode.FULL, max_length=255) on Profile.
Migration
apps/api/plane/db/migrations/0116_profile_notification_view_mode_and_more.py
New migration adding Profile.notification_view_mode (char choices, default full) and User.is_password_reset_required (boolean, default False); depends on ('db', '0115_auto_20260105_1406').

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hopped through fields both new and bright,
A flag for passwords, a view set right,
Full or compact, the notices play,
Migration danced and hopped away! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title partially relates to the changeset by mentioning 'User table migrations', but it omits the Profile model changes (notification_view_mode field) which represent a significant part of the changes.
Description check ✅ Passed The description covers the main User model change and its purpose, but it completely omits the Profile.notification_view_mode field addition which is equally significant in the changeset. However, most required template sections are addressed or marked.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a12559 and 73aaeef.

📒 Files selected for processing (1)
  • apps/api/plane/db/migrations/0116_profile_notification_view_mode_and_more.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/api/plane/db/migrations/0116_profile_notification_view_mode_and_more.py
⏰ 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). (1)
  • GitHub Check: Analyze (javascript)

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.

@makeplane
Copy link

makeplane bot commented Jan 8, 2026

Linked to Plane Work Item(s)

This comment was auto-generated by Plane

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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_required field is correctly positioned with other boolean flags and follows existing naming conventions. The default of False is 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

📥 Commits

Reviewing files that changed from the base of the PR and between b83d460 and f627297.

📒 Files selected for processing (2)
  • apps/api/plane/db/migrations/0116_user_is_password_reset_required.py
  • apps/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.py
  • apps/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_required field with a sensible default of False, 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_required field is added to the User model but has no corresponding implementation to enforce password resets. A similar field is_password_autoset is 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.

@sangeethailango
Copy link
Member

@vamsikrishnamathala @JayashTripathy We already have one open #8489 for migrations, so we will add these changes to that PR and close this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔄migrations Contains Migration changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants