-
-
Notifications
You must be signed in to change notification settings - Fork 313
Fix: Removed Email Restrictions for Creating New Organization. #4008
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
Fix: Removed Email Restrictions for Creating New Organization. #4008
Conversation
WalkthroughThis change removes the logic enforcing domain-specific email restrictions from the organization login flow. The restricted email domain list and the email domain extraction function have been eliminated. Additionally, the error messages in the organization view have been updated to a more general prompt, streamlining the authentication process. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant OV as Organization_view
U->>OV: Submit login/organization creation request
alt Old Flow
OV->>OV: Extract email domain using get_email_domain()
OV->>OV: Check if domain is in restricted_domain list
OV-->>U: Return specific error message if domain is restricted
else New Flow
OV->>OV: Process login without domain extraction/checks
OV-->>U: Return generalized error message when access conditions arenβt met
end
Assessment against linked issues
Suggested Reviewers
β¨ Finishing Touches
πͺ§ 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
π Outside diff range comments (1)
website/views/company.py (1)
657-661: π‘ Verification agentπ§© Analysis chain
Consider updating domain validation for consistency
While the PR objective is to remove email restrictions for organization creation, this validation still enforces domain-specific email requirements when adding domains to an organization. For complete consistency with the PR's goal, consider whether this validation should also be removed.
π Script executed:
#!/bin/bash # Check for other domain restrictions in the codebase grep -r "email.*domain" --include="*.py" .Length of output: 3145
Action Required: Update Domain Validation for Consistency with PR Objectives
The PR aims to remove email restrictions for organization creation, yet the validation in
website/views/company.py(lines 657β661) still forces users to have matching email domains when adding a domain. Note that similar domain-related checks are present elsewhere in the repository (e.g., repeated in this file and indirectly viawebsite/utils.py). To fully align with the PR goal, please consider either removing or conditionally bypassing these validations when organization-level email restrictions are intended to be lifted.
- Location:
website/views/company.py(lines 657β661)- Suggestion: Reevaluate the need for the domain validation in this context and update or remove the conditional check accordingly.
π§Ή Nitpick comments (1)
website/views/company.py (1)
663-670: Manager email domain validation may need similar treatmentSimilar to the domain validation above, this code block still enforces domain-specific email requirements for managers. Consider whether this validation should also be removed for consistency with the PR's objective of eliminating email domain restrictions.
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (1)
website/views/company.py(1 hunks)
β° Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Run Tests
- GitHub Check: docker-test
π Additional comments (1)
website/views/company.py (1)
85-85: Improved error message for anonymous usersThe error message has been updated to be more generic, aligning with the PR objective of removing email domain restrictions. This change is part of a broader update to eliminate domain-specific email validation when users try to access their organization.
Fixes #4007
Description:
This PR removes all email domain restrictions for new organization registration. Now, users with any valid email can register for an organization and access all organization-related paths without email domain based limitations.
Summary by CodeRabbit