diff --git a/conditional/blueprints/intro_evals.py b/conditional/blueprints/intro_evals.py index e4464c3..262ae18 100644 --- a/conditional/blueprints/intro_evals.py +++ b/conditional/blueprints/intro_evals.py @@ -1,5 +1,3 @@ -from datetime import datetime - import structlog from flask import Blueprint, request from sqlalchemy import func @@ -82,8 +80,7 @@ def get_intro_members_without_accounts(): # freshmen who don't have accounts freshman_accounts = list(FreshmanAccount.query.filter( - FreshmanAccount.eval_date > semester_start, - FreshmanAccount.eval_date > datetime.now())) + FreshmanAccount.eval_date >= semester_start)) ie_members = [] @@ -124,6 +121,8 @@ def get_intro_members_without_accounts(): } ie_members.append(freshman) + print(ie_members) + return ie_members @intro_evals_bp.route('/intro_evals/') @@ -197,7 +196,7 @@ def display_intro_evals(internal=False, user_dict=None): uid = member.uid name = member.cn freshman_data = FreshmanEvalData.query.filter( - FreshmanEvalData.eval_date > semester_start, + FreshmanEvalData.eval_date >= semester_start, FreshmanEvalData.uid == uid).first() if freshman_data is None: diff --git a/conditional/util/member.py b/conditional/util/member.py index f091cd4..0c171a3 100644 --- a/conditional/util/member.py +++ b/conditional/util/member.py @@ -143,11 +143,12 @@ def get_hm(member, only_absent=False): return h_meetings -@service_cache(maxsize=128) +# @service_cache(maxsize=128) # Can't hash because members_on_coop is a list def req_cm(uid, members_on_coop=None): # Get the number of required committee meetings based on if the member # is going on co-op in the current operating session. on_coop = False + if members_on_coop: on_coop = uid in members_on_coop else: @@ -162,9 +163,9 @@ def req_cm(uid, members_on_coop=None): def is_gatekeep_active(): - today = datetime.today() - before_evals_one = len(FreshmanAccount.query.filter(FreshmanAccount.eval_date > today).limit(1).all()) - before_evals_two = len(FreshmanEvalData.query.filter(FreshmanEvalData.eval_date > today).limit(1).all()) + today = datetime.today().date() + before_evals_one = len(FreshmanAccount.query.filter(FreshmanAccount.eval_date >= today).limit(1).all()) + before_evals_two = len(FreshmanEvalData.query.filter(FreshmanEvalData.eval_date >= today).limit(1).all()) return not (before_evals_one > 0 or before_evals_two > 0)