Skip to content

Commit ee66832

Browse files
authored
Use exclude keyword in dict method to exclude Action callable field (#142)
The model config approach we used in d46eb39 seemed to help with the `/powered_by_jbi` endpoint, but we were still seeing failures in `/whiteboard_tags`. We found that using the .dict(exclude=<...>) method seemed to _actually_ exclude the `callable` field.
1 parent 68afbb4 commit ee66832

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/app/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def get_whiteboard_tags(
112112
filtered = {whiteboard_tag: existing}
113113
else:
114114
filtered = actions.by_tag # type: ignore
115-
return {k: v.dict() for k, v in filtered.items()}
115+
return {k: v.dict(exclude={"callable"}) for k, v in filtered.items()}
116116

117117

118118
@app.get("/jira_projects/")
@@ -132,7 +132,7 @@ def powered_by_jbi(
132132
context = {
133133
"request": request,
134134
"title": "Powered by JBI",
135-
"actions": [action.dict() for action in actions],
135+
"actions": [action.dict(exclude={"callable"}) for action in actions],
136136
"enable_query": enabled,
137137
}
138138
return templates.TemplateResponse("powered_by_template.html", context)

0 commit comments

Comments
 (0)