File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
frameworks/Python/litestar Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ async def multiple_database_queries(queries: Any = None) -> Response:
94
94
)
95
95
96
96
97
- @get ("/fortunes" , media_type = MediaType .TEXT )
97
+ @get ("/fortunes" , media_type = MediaType .HTML )
98
98
async def fortunes (request : Request ) -> Template :
99
99
async with app .state .connection_pool .acquire () as connection :
100
100
fortunes = await connection .fetch ("SELECT * FROM Fortune" )
@@ -104,7 +104,7 @@ async def fortunes(request: Request) -> Template:
104
104
return Template (
105
105
"fortune.html" ,
106
106
context = {"fortunes" : fortunes , "request" : request },
107
- media_type = MediaType .TEXT ,
107
+ media_type = MediaType .HTML ,
108
108
)
109
109
110
110
Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ async def multiple_database_queries(queries: Any = None) -> Response:
126
126
)
127
127
128
128
129
- @get ("/fortunes" , media_type = MediaType .TEXT )
129
+ @get ("/fortunes" , media_type = MediaType .HTML )
130
130
async def fortunes (request : Request ) -> Template :
131
131
async with app .state .db_session () as sess :
132
132
ret = await sess .execute (select (Fortune .id , Fortune .message ))
@@ -138,7 +138,7 @@ async def fortunes(request: Request) -> Template:
138
138
return Template (
139
139
"fortune.jinja" ,
140
140
context = {"request" : request , "fortunes" : data },
141
- media_type = MediaType .TEXT ,
141
+ media_type = MediaType .HTML ,
142
142
)
143
143
144
144
File renamed without changes.
You can’t perform that action at this time.
0 commit comments