Open ermsdev opened 4 years ago
just a quick note for this
querying an election ON ASWWU.COM by start_before
or end_after
works but if you query by start
or end
you get the same issue of
{
"status": "strptime() argument 1 must be string, got None"
}
Fixing this would just be a simple refactor
accidentally closed
https://github.com/ASWWU-Web/python_server/blob/c0f3549ca2c0631a87d833a9c7c2594f7b0db7de/src/aswwu/route_handlers/elections.py#L17-L24
This may have been written before we implemented
start_before
,start_after
,end_before
,end_after
as query parameters. Since we no longer use query parametersstart
, andend
this conditional always branches to the else line, as a result this function returns the same dictionary as its input, with the exception that elements are not represented as lists.If a
start
orend
parameter is provided, it does branch on the if statement, which causes an exception to be thrown. this is because thestrptime
function is given a None object fromsearch_criteria
. This object was probably intended to berequest_arguments
instead.Some considerations and things to investigate before fixing this:
and lastly, since this is similar to a function we'll be adding in the notifications project, we should find a good place to add a shared function or utility like this, and similar functions.