(self, request)
| 55 | ) |
| 56 | |
| 57 | def on_new_url(self, request): |
| 58 | error = None |
| 59 | url = "" |
| 60 | if request.method == "POST": |
| 61 | url = request.form["url"] |
| 62 | if not is_valid_url(url): |
| 63 | error = "Please enter a valid URL" |
| 64 | else: |
| 65 | short_id = self.insert_url(url) |
| 66 | return redirect(f"/{short_id}+") |
| 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}") |
nothing calls this directly
no test coverage detected