Skip to content

Commit

Permalink
removed error on non-matching question status
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Bagiński committed Aug 17, 2023
1 parent 92fde0f commit 3d57364
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
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

0 comments on commit 3d57364

Please sign in to comment.