Aug 6 - Add enrollment page
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
"""
|
||||
app/enrollment
|
||||
--------------
|
||||
The JQC Enrollment Form — a self-contained onboarding intake, deliberately
|
||||
held apart from the rest of the application.
|
||||
|
||||
/enrollment public form emailed to a prospective customer
|
||||
/enrollment/admin admin-only inbox of submissions
|
||||
|
||||
Separation contract (please keep this true)
|
||||
-------------------------------------------
|
||||
1. NO app.models imports, and nothing here writes to the database. Enrollment
|
||||
happens before any contract, facility or user exists, so there is nothing to
|
||||
key a row against. Submissions are flat JSON files (see storage.py).
|
||||
2. NO migration, NO model, NO notification-matrix event, NO iPad/API surface.
|
||||
Deleting this package would remove the two routes and nothing else.
|
||||
3. Its own template folder (app/enrollment/templates/enrollment/) — enrollment
|
||||
markup never mixes into app/templates.
|
||||
4. The only shared code it uses is what it should not reinvent: the app factory,
|
||||
Flask-WTF CSRF, the rate limiter, and @admin_required.
|
||||
|
||||
If this ever needs to CREATE the accounts it describes, do that as a separate,
|
||||
explicit admin action that reads a stored submission — do not let the public
|
||||
form reach into the app's models.
|
||||
"""
|
||||
|
||||
from .routes import bp # noqa: F401 (re-exported for register_enrollment)
|
||||
|
||||
|
||||
def register_enrollment(app):
|
||||
"""Register the blueprint and make sure the storage directory exists."""
|
||||
import os
|
||||
|
||||
app.config.setdefault(
|
||||
'ENROLLMENT_DIR',
|
||||
os.path.join(app.instance_path, 'enrollments'),
|
||||
)
|
||||
os.makedirs(app.config['ENROLLMENT_DIR'], exist_ok=True)
|
||||
app.register_blueprint(bp)
|
||||
app.logger.info('Enrollment | storage dir: %s', app.config['ENROLLMENT_DIR'])
|
||||
Reference in New Issue
Block a user