Skip to content

Commit 1d12211

Browse files
committed
remove max_terms
1 parent f3f59f2 commit 1d12211

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

src/officers/crud.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ async def get_officer_info(db_session: database.DBSession, computing_id: str) ->
129129
async def get_officer_terms(
130130
db_session: database.DBSession,
131131
computing_id: str,
132-
max_terms: None | int,
133132
include_future_terms: bool,
134133
) -> list[OfficerTerm]:
135134
query = (
@@ -140,8 +139,6 @@ async def get_officer_terms(
140139
)
141140
if not include_future_terms:
142141
query = utils.has_started_term(query)
143-
if max_terms is not None:
144-
query.limit(max_terms)
145142

146143
return (await db_session.scalars(query)).all()
147144

src/officers/urls.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ async def get_officer_terms(
110110
request: Request,
111111
db_session: database.DBSession,
112112
computing_id: str,
113-
# TODO: remove `max_terms`
114-
# the maximum number of terms to return, in chronological order
115-
# helpful if you only want the most recent... though a person can have many active terms,
116-
# so not really that helpful imo....
117-
max_terms: int | None = None,
118113
include_future_terms: bool = False
119114
):
120115
# TODO: should this be login-required if a user does not want to include future terms? The info is
@@ -132,7 +127,6 @@ async def get_officer_terms(
132127
officer_terms = await officers.crud.get_officer_terms(
133128
db_session,
134129
computing_id,
135-
max_terms,
136130
include_future_terms
137131
)
138132
return JSONResponse([
@@ -251,7 +245,7 @@ async def update_info(
251245
old_officer_info = await officers.crud.get_officer_info(db_session, computing_id)
252246
validation_failures, corrected_officer_info = await officer_info_upload.validate(computing_id, old_officer_info)
253247

254-
# TODO: log all important changes just to a .log file & persist them for a few years
248+
# TODO (#27): log all important changes just to a .log file & persist them for a few years
255249

256250
success = await officers.crud.update_officer_info(db_session, corrected_officer_info)
257251
if not success:
@@ -304,7 +298,7 @@ async def update_term(
304298
# TODO: update the end_date here
305299
pass
306300

307-
# TODO: log all important changes to a .log file
301+
# TODO (#27): log all important changes to a .log file
308302
success = await officers.crud.update_officer_term(
309303
db_session,
310304
officer_term_upload.to_officer_term(term_id, old_officer_term.computing_id)
@@ -338,7 +332,7 @@ async def remove_officer(
338332

339333
deleted_officer_term = await officers.crud.get_officer_term_by_id(db_session, term_id)
340334

341-
# TODO: log all important changes to a .log file
335+
# TODO (#27): log all important changes to a .log file
342336
await officers.crud.delete_officer_term_by_id(db_session, term_id)
343337

344338
return JSONResponse({

0 commit comments

Comments
 (0)