Skip to content
Snippets Groups Projects
Commit 12d401c1 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Fix types

parent a7cc0ecd
Branches
Tags
No related merge requests found
......@@ -122,11 +122,11 @@ def list_surveys() -> Any:
class SurveyDict(TypedDict):
year: int
status: str
responses: List[Dict[str, str]]
responses: List[Dict[str, Any]]
entries: List[SurveyDict] = []
def _get_response(response: SurveyResponse) -> Dict[str, str]:
def _get_response(response: SurveyResponse) -> Dict[str, Any]:
res = {
"nren": {
'name': response.nren.name,
......@@ -148,8 +148,8 @@ def list_surveys() -> Any:
"status": entry.status.value,
"responses": [_get_response(r) for r in sorted(entry.responses, key=response_key)]
})
nrens = db.session.scalars(select(NREN)).all()
nrens = {nren.name: nren.id for nren in nrens}
all_nrens = db.session.scalars(select(NREN)).all()
nrens = {nren.name: nren.id for nren in all_nrens}
nren_names = set(nrens.keys())
for survey_dict in entries:
# add in nrens without a response if the survey is open
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment