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

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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