Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed error on non-matching question status #320

Merged
merged 1 commit into from
Aug 18, 2023
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
11 changes: 4 additions & 7 deletions api/coda.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,18 +522,15 @@ def get_all_statuses(self) -> list[str]:
r["Status"].value for r in status_table.rows() if r["Status"].value
}
# load status values defined in code
code_status_vals = set(get_args(QuestionStatus))
encoded_status_vals = set(get_args(QuestionStatus))
# if mismatch, log and raise errory
if coda_status_vals != code_status_vals:
msg = "Status values defined in api/utilities/coda_utils.py don't match the values in coda"
self.log.error(
if coda_status_vals != encoded_status_vals:
self.log.warning(
self.class_name,
msg="Status values defined in api/utilities/coda_utils.py don't match the values in coda",
code_status_vals=code_status_vals,
code_status_vals=encoded_status_vals,
coda_status_vals=coda_status_vals,
)
msg += f"; {code_status_vals=}; {coda_status_vals=}"
raise AssertionError(msg)
return sorted(coda_status_vals)

@staticmethod
Expand Down
1 change: 1 addition & 0 deletions api/utilities/coda_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class QuestionRow(TypedDict):
QuestionStatus = Literal[
"Bulletpoint sketch",
"Duplicate",
"Dormant",
"In progress",
"In review",
"Live on site",
Expand Down
Loading