Passed
Push — master ( 105c1e...a48eb1 )
by Swen
02:08
created

get_language_codes()   A

Complexity

Conditions 2

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
c 1
b 0
f 1
dl 0
loc 15
rs 9.4285
ccs 2
cts 2
cp 1
crap 2
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 1
    return [
19
        lang_code
20
        for lang_code, _ in settings.LANGUAGES
21
    ]
22