404 on missing packets.

This commit is contained in:
Jason Michalski
2024-07-15 14:37:51 -07:00
parent 7fd735353d
commit b7667485b3
+4
View File
@@ -431,6 +431,10 @@ async def chat(request):
@routes.get("/packet/{packet_id}")
async def packet(request):
packet = await store.get_packet(int(request.match_info["packet_id"]))
if not packet:
return web.Response(
status=404,
)
template = env.get_template("packet_index.html")
return web.Response(
text=template.render(packet=Packet.from_model(packet)),