Description
Student email domains (@student.annauniv.edu) and faculty email domains (@faculty.annauniv.edu) are hardcoded in app.py. This makes the application institution-specific and prevents easy deployment for other educational organizations.
Location
app.py:37-39
if not (email.endswith('@student.annauniv.edu') or email.endswith('@faculty.annauniv.edu')):
flash('Only @student.annauniv.edu and @faculty.annauniv.edu emails are allowed!', 'danger')
return redirect(url_for('register'))
Impact
- Cannot deploy for other institutions without modifying source code
- Forking requires code changes to use different domains
- Configuration should be externalized for flexibility
Recommended Enhancement
-
Move domains to environment variables:
STUDENT_EMAIL_DOMAIN = os.environ.get('STUDENT_EMAIL_DOMAIN', '@student.annauniv.edu')
FACULTY_EMAIL_DOMAIN = os.environ.get('FACULTY_EMAIL_DOMAIN', '@faculty.annauniv.edu')
ALLOWED_DOMAINS = os.environ.get('ALLOWED_DOMAINS', '').split(',') or [
STUDENT_EMAIL_DOMAIN,
FACULTY_EMAIL_DOMAIN
]
-
Update the validation to use configurable domains:
if not any(email.endswith(domain) for domain in ALLOWED_DOMAINS):
flash(f'Only emails from {", ".join(ALLOWED_DOMAINS)} are allowed!', 'danger')
return redirect(url_for('register'))
-
Allow administrators to configure allowed domains through an admin settings page
Description
Student email domains (
@student.annauniv.edu) and faculty email domains (@faculty.annauniv.edu) are hardcoded inapp.py. This makes the application institution-specific and prevents easy deployment for other educational organizations.Location
app.py:37-39Impact
Recommended Enhancement
Move domains to environment variables:
Update the validation to use configurable domains:
Allow administrators to configure allowed domains through an admin settings page