1010import sentry_sdk
1111import uvicorn # type: ignore
1212from fastapi import Body , Depends , FastAPI , Request
13- from fastapi .encoders import jsonable_encoder
1413from fastapi .responses import HTMLResponse
1514from fastapi .staticfiles import StaticFiles
1615from fastapi .templating import Jinja2Templates
@@ -104,14 +103,16 @@ def bugzilla_webhook(
104103
105104
106105@app .get ("/whiteboard_tags/" )
107- def get_whiteboard_tag (
106+ def get_whiteboard_tags (
108107 whiteboard_tag : Optional [str ] = None ,
109108 actions : Actions = Depends (configuration .get_actions ),
110109):
111110 """API for viewing whiteboard_tags and associated data"""
112111 if existing := actions .get (whiteboard_tag ):
113- return {whiteboard_tag : existing }
114- return actions .by_tag
112+ filtered = {whiteboard_tag : existing }
113+ else :
114+ filtered = actions .by_tag # type: ignore
115+ return {k : v .dict () for k , v in filtered .items ()}
115116
116117
117118@app .get ("/jira_projects/" )
@@ -131,7 +132,7 @@ def powered_by_jbi(
131132 context = {
132133 "request" : request ,
133134 "title" : "Powered by JBI" ,
134- "actions" : jsonable_encoder ( actions ) ,
135+ "actions" : [ action . dict () for action in actions ] ,
135136 "enable_query" : enabled ,
136137 }
137138 return templates .TemplateResponse ("powered_by_template.html" , context )
0 commit comments