fix: email check validation to handle case in-sensitive email#6168
fix: email check validation to handle case in-sensitive email#6168sriramveeraghanta merged 1 commit intopreviewfrom
Conversation
WalkthroughThe changes involve modifications to the Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (3)
apiserver/plane/authentication/views/space/check.py (2)
63-63: LGTM! Consider adding a comment for clarity.The email normalization is correctly placed and handles both case-insensitivity and whitespace. Consider adding a brief comment explaining the normalization step.
+ # Normalize email: convert to lowercase and remove whitespace email = str(email).lower().strip()
63-63: Consider extracting email normalization to a utility function.Since this email normalization logic is duplicated in both endpoints, consider extracting it to a shared utility function to maintain DRY principles and ensure consistent email handling across the application.
# In plane/authentication/utils.py def normalize_email(email): """ Normalize email address by converting to lowercase and removing whitespace. Args: email: The email address to normalize Returns: str: Normalized email address """ return str(email).lower().strip()Then use it in both endpoints:
- email = str(email).lower().strip() + email = normalize_email(email)apiserver/plane/authentication/views/app/check.py (1)
63-65: LGTM! Minor style suggestion.The email normalization logic is correct and the added comment improves clarity. However, the extra blank line at line 65 seems unnecessary.
# Lower the email email = str(email).lower().strip() - # Validate email
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
apiserver/plane/authentication/views/app/check.py(1 hunks)apiserver/plane/authentication/views/space/check.py(1 hunks)
Description
Added email check validation for lowering the email in the email-check endpoint.
Summary by CodeRabbit
New Features
Bug Fixes