-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrejestracjaController.py
36 lines (34 loc) · 1.19 KB
/
rejestracjaController.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
import userDAO
def rejestruj_uzytkownika_controller(form):
if form['password'][0] == form['passwordRepeat'][0]:
if 'undefined' in dict(form).keys():
del form['undefined']
sleep = 1
if form['registerMode'][0] == "join":
sleep = 0
del form['registerMode']
login = form['login'][0]
del form['login']
email = form['email'][0]
del form['email']
password = form['password'][0]
del form['password']
del form['passwordRepeat']
remote = 0
if 'remote' in dict(form).keys():
del form['remote']
remote = 1
czyPedagog = 0
if 'experience' in dict(form).keys():
del form['experience']
czyPedagog = 1
miejscowosc = form['location']
del form['location']
skillsTuple = ()
for key in form:
skillsTuple = skillsTuple + (key,)
# if userDAO.add_user(login, email, password, skillsList, remote, czyPedagog, sleep, miejscowosc):
if userDAO.add_user(login, email, password, skillsTuple, remote, czyPedagog, sleep, miejscowosc):
return True
else:
return False