Passed
Push — master ( 708cb0...cec1f3 )
by Jace
06:26
created

get_index()   A

Complexity

Conditions 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
c 0
b 0
f 0
dl 0
loc 10
rs 9.4285
ccs 4
cts 4
cp 1
crap 1
1 1
import random
2
3 1
from flask import Blueprint, render_template, current_app
4
5 1
from ._utils import samples
6
7
8 1
blueprint = Blueprint('index-page', __name__)
9
10
11 1
@blueprint.route("/")
12
def get():
13 1
    template_images = list(samples(blank=True))
14 1
    return render_template(
15 1
        "index.html",
16
        template_images=template_images,
17
        default_template=random.choice(template_images)['key'],
18
        config=current_app.config,
19
    )
20