Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions conditional/blueprints/intro_evals.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from datetime import datetime

import structlog
from flask import Blueprint, request
from sqlalchemy import func
Expand Down Expand Up @@ -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 = []

Expand Down Expand Up @@ -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/')
Expand Down Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions conditional/util/member.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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)

Expand Down
Loading