ui update and some backend functionality adding in accordance with research on adhd and ux design
This commit is contained in:
@@ -8,6 +8,7 @@ import flask
|
||||
import jwt
|
||||
import core.auth as auth
|
||||
import core.postgres as postgres
|
||||
import core.tz as tz
|
||||
|
||||
|
||||
def _get_user_uuid(token):
|
||||
@@ -128,7 +129,7 @@ def register(app):
|
||||
"routines_started": 0,
|
||||
"routines": [],
|
||||
}), 200
|
||||
week_ago = (datetime.now() - timedelta(days=7)).isoformat()
|
||||
week_ago = (tz.user_now() - timedelta(days=7)).isoformat()
|
||||
sessions = postgres.select("routine_sessions", where={"user_uuid": user_uuid})
|
||||
week_sessions = [s for s in sessions if s.get("created_at") and str(s["created_at"]) >= week_ago]
|
||||
completed = [s for s in week_sessions if s.get("status") == "completed"]
|
||||
|
||||
Reference in New Issue
Block a user