Total Complexity | 2 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | 1 | from flask import Blueprint, current_app |
|
|
|||
2 | 1 | from flask_api import exceptions |
|
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 |