Passed
Push — master ( 680383...105c1e )
by Swen
02:15
created

get_language_codes()   A

Complexity

Conditions 2

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 2.5

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
c 1
b 0
f 1
dl 0
loc 15
ccs 1
cts 2
cp 0.5
crap 2.5
rs 9.4285
1 1
from typing import List
2
3 1
from django.conf import settings
4
5
6 1
def get_language_codes() -> List[str]:
7
    """Gets a list of all available language codes.
8
9
    This looks at your project's settings.LANGUAGES
10
    and returns a flat list of the configured
11
    language codes.
12
13
    Arguments:
14
        A flat list of all availble language codes
15
        in your project.
16
    """
17
18
    return [
19
        lang_code
20
        for lang_code, _ in settings.LANGUAGES
21
    ]
22