| Total Complexity | 4 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 84.62% |
| Changes | 0 | ||
| 1 | 1 | from flask import Blueprint, current_app as app, redirect |
|
|
|
|||
| 2 | |||
| 3 | 1 | from ._utils import route |
|
| 4 | |||
| 5 | |||
| 6 | 1 | blueprint = Blueprint('legacy', __name__) |
|
| 7 | |||
| 8 | |||
| 9 | 1 | @blueprint.route("/templates/") |
|
| 10 | def legacy_templates_index(): |
||
| 11 | 1 | return redirect(route('templates.get')) |
|
| 12 | |||
| 13 | |||
| 14 | 1 | @blueprint.route("/<key>") |
|
| 15 | def legacy_templates_detail(key): |
||
| 16 | template = app.template_service.find(key) |
||
| 17 | return redirect(route('templates.create', key=template.key)) |
||
| 18 | |||
| 19 | |||
| 20 | 1 | @blueprint.route("/<key>/<path:path>") |
|
| 21 | def legacy_links_detail(**kwargs): |
||
| 22 | 1 | return redirect(route('links.get', **kwargs)) |
|
| 23 | |||
| 24 | |||
| 25 | 1 | @blueprint.route("/_<code>") |
|
| 26 | def legacy_links_detail_encoded(code): |
||
| 27 | 1 | key, path = app.link_service.decode(code) |
|
| 28 | return redirect(route('links.get', key=key, path=path)) |
||
| 29 |