MCPcopy
hub / github.com/pallets/werkzeug / on_short_link_details

Method on_short_link_details

examples/shortly/shortly.py:76–86  ·  view source on GitHub ↗
(self, request, short_id)

Source from the content-addressed store, hash-verified

74 return redirect(link_target)
75
76 def on_short_link_details(self, request, short_id):
77 link_target = self.redis.get(f"url-target:{short_id}")
78 if link_target is None:
79 raise NotFound()
80 click_count = int(self.redis.get(f"click-count:{short_id}") or 0)
81 return self.render_template(
82 "short_link_details.html",
83 link_target=link_target,
84 short_id=short_id,
85 click_count=click_count,
86 )
87
88 def error_404(self):
89 response = self.render_template("404.html")

Callers

nothing calls this directly

Calls 3

render_templateMethod · 0.95
NotFoundClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected