Ban .edu email domains in pricing form validation#1445
Merged
Conversation
- Add generalized .edu domain validation using endswith('.edu') check
- Prevents educational institution emails from being submitted in demo request form
- Maintains existing banned domain validation for consumer email providers
- Uses pattern matching instead of hardcoding specific university domains
Co-Authored-By: Alek <alek@pynecone.io>
Contributor
There was a problem hiding this comment.
PR Summary
Added validation in pcweb/pages/pricing/header.py to prevent educational institution emails from submitting demo requests by blocking .edu domains.
- Implemented pattern matching using
domain.endswith('.edu')check alongside existing banned domain validation - Maintains consistent error handling showing 'Personal emails not allowed!' message
- Uses existing UI feedback with red border for invalid submissions
- Preserves all current form validation behavior for non-.edu domains
1 file reviewed, 1 comment
Edit PR Review Bot Settings | Greptile
pcweb/pages/pricing/header.py
Outdated
| if "@" in email: | ||
| domain = email.split("@")[1] | ||
| if domain in banned_domains: | ||
| if domain in banned_domains or domain.endswith('.edu'): |
Contributor
There was a problem hiding this comment.
style: Consider using a dedicated error message for .edu emails (e.g., 'Educational institution emails are not allowed') instead of reusing 'Personal emails not allowed!'
- Run ruff format to fix code formatting - Fix import sorting in header.py - Address pre-commit hook formatting requirements Co-Authored-By: Alek <alek@pynecone.io>
- Apply ruff formatting to all modified files - Address remaining pre-commit formatting requirements - Ensure consistent code style across codebase Co-Authored-By: Alek <alek@pynecone.io>
- Change from domain.endswith('.edu') to '.edu' in domain
- Now catches domains like 'uncp.edu.pe' where .edu appears in middle
- Tested locally: rejects test@uncp.edu.pe, allows john@company.com
- Addresses user feedback for more comprehensive .edu blocking
Co-Authored-By: Alek <alek@pynecone.io>
tgberkeley
approved these changes
Jun 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ban .edu email domains in pricing form validation
Summary
This PR implements generalized validation logic to ban .edu email domains in the pricing form, preventing educational institution emails from being submitted in demo requests.
Changes Made
pcweb/pages/pricing/header.pyto add.edudomain validation usingdomain.endswith('.edu')Implementation Details
The validation logic now checks:
This approach is:
Testing
✅ Tested locally with
reflex runTest Screenshots
Link to Devin run
https://app.devin.ai/sessions/e21a6af3d9354f7d9ac4294e054bb675
Requested by: Alek (alek@reflex.dev)