memegen.routes.api_fonts.create_font()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 0
cts 0
cp 0
crap 2
1 1
from flask import Blueprint, current_app
0 ignored issues
show
introduced by
Unable to import 'flask'
Loading history...
2 1
from flask_api import exceptions
0 ignored issues
show
introduced by
Unable to import 'flask_api'
Loading history...
3
4
from ..extensions import cache
5 1
6
7
blueprint = Blueprint('fonts', __name__, url_prefix="/api/fonts/")
8 1
9
10
@blueprint.route("")
11 1
@cache.cached()
12
def get():
13
    """Get a list of all available fonts."""
14 1
    return sorted(current_app.font_service.all())
15
16 1
17
@blueprint.route("", methods=['POST'])
18
def create_font():
19
    raise exceptions.PermissionDenied(current_app.config['CONTRIBUTING_URL'])
20