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

Method on_follow_short_link

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

Source from the content-addressed store, hash-verified

67 return self.render_template("new_url.html", error=error, url=url)
68
69 def on_follow_short_link(self, request, short_id):
70 link_target = self.redis.get(f"url-target:{short_id}")
71 if link_target is None:
72 raise NotFound()
73 self.redis.incr(f"click-count:{short_id}")
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}")

Callers

nothing calls this directly

Calls 3

NotFoundClass · 0.90
redirectFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected