Feb 02 2026: implement remembering logged in, correct timezone

This commit is contained in:
2026-02-28 12:37:20 -05:00
parent 998569d402
commit ab2d5546b4
11 changed files with 53 additions and 20 deletions
+3 -2
View File
@@ -11,8 +11,9 @@ from app.models.user import User
# ── Auth ─────────────────────────────────────────────────────────────────────
class LoginForm(FlaskForm):
username = StringField('Username', validators=[DataRequired(), Length(min=3, max=100)])
password = PasswordField('Password', validators=[DataRequired()])
username = StringField('Username', validators=[DataRequired(), Length(min=3, max=100)])
password = PasswordField('Password', validators=[DataRequired()])
remember_me = BooleanField('Keep me logged in')
class UserForm(FlaskForm):
+24
View File
@@ -0,0 +1,24 @@
"""
time_utils.py
-------------
Centralised time helpers for the JQC application.
All timestamps are stored as Eastern Time (America/New_York) so that
displayed dates reflect the local business timezone without any
conversion layer in templates or reports.
"""
from datetime import datetime
import pytz
EASTERN = pytz.timezone('America/New_York')
def now_eastern() -> datetime:
"""Return the current wall-clock time in US/Eastern (naive datetime).
Stored as a naive datetime in the database so that existing DateTime
columns require no schema change. The value is always Eastern local
time (auto-adjusts for EDT / EST).
"""
return datetime.now(tz=EASTERN).replace(tzinfo=None)