Completed
Pull Request — master (#244)
by Jace
10:30
created

legacy_links_detail_encoded()   A

Complexity

Conditions 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 4
rs 10
1
from collections import OrderedDict
0 ignored issues
show
Unused Code introduced by
Unused OrderedDict imported from collections
Loading history...
2
3
from flask import Blueprint, current_app as app, redirect
0 ignored issues
show
Configuration introduced by
The import flask could not be resolved.

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
4
5
from ..domain import Text
0 ignored issues
show
Unused Code introduced by
Unused Text imported from domain
Loading history...
6
7
from ._utils import route
8
9
10
blueprint = Blueprint('legacy', __name__)
11
12
13
@blueprint.route("/templates/")
14
def legacy_templates_index():
15
    return redirect(route('templates.get'))
16
17
18
@blueprint.route("/<key>")
19
def legacy_templates_detail(key):
20
    template = app.template_service.find(key)
21
    return redirect(route('templates.create', key=template.key))
22
23
24
@blueprint.route("/<key>/<path:path>")
25
def legacy_links_detail(**kwargs):
26
    return redirect(route('links.get', **kwargs))
27
28
29
@blueprint.route("/_<code>")
30
def legacy_links_detail_encoded(code):
31
    key, path = app.link_service.decode(code)
32
    return redirect(route('links.get', key=key, path=path))
33