Skip to content

Commit eec4bd1

Browse files
committed
small bug fixes
1 parent 4d0131a commit eec4bd1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/permission/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async def has_permission(db_session: database.DBSession, computing_id: str) -> b
1818
A semester is defined in semester_start
1919
"""
2020

21-
term_list = await officers.crud.get_officer_terms(db_session, computing_id)
21+
term_list = await officers.crud.get_officer_terms(db_session, computing_id, include_future_terms=False)
2222
for term in term_list:
2323
if utils.is_active_term(term):
2424
return True

src/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ def is_active_officer(query: Select) -> Select:
3434
)
3535
)
3636

37+
def has_started_term(query: Select) -> bool:
38+
return query.where(
39+
OfficerTerm.start_date <= date.today()
40+
)
41+
3742
def is_active_term(term: OfficerTerm) -> bool:
3843
return (
3944
# cannot be an officer who has not started yet
@@ -46,9 +51,6 @@ def is_active_term(term: OfficerTerm) -> bool:
4651
)
4752
)
4853

49-
def has_started_term(term: OfficerTerm) -> bool:
50-
return term.start_date <= date.today()
51-
5254
def is_past_term(term: OfficerTerm) -> bool:
5355
"""Any term which has concluded"""
5456
return (

0 commit comments

Comments
 (0)