-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpers.py
42 lines (39 loc) · 856 Bytes
/
helpers.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from flask import redirect, session
from functools import wraps
def login_required(f):
@wraps(f)
def decorated_function(*args, **kwargs):
if session.get("user_id") is None:
return redirect("/login")
return f(*args, **kwargs)
return decorated_function
def get_oblasts():
""" All the regions of Ukraine """
oblasts = [
"Donets'ka oblast",
"Dnipropetrovs'ka oblast",
"Kyiv",
"Kharkivs'ka oblast",
"L'vivs'ka oblast",
"Odessa",
"Luhans'ka oblast",
"Crimea",
"Zaporizhzhia",
"Vinnytsia",
"Ivano-Frankivsk",
"Khmel'nyts'kyy oblast",
"Zakarpattia",
"Zhytomyr",
"Cherkasy",
"Rivne",
"Mykolaiv",
"Sumy",
"Ternopil",
"Kherson",
"Chernihiv",
"Volyn",
"Kirovohrad",
"Chernivtsi",
"Sevastopol"
]
return oblasts