def list_to_user(user_list): u = User() u.set_id(user_list[0]) u.set_username(user_list[1]) u.set_password(user_list[2]) u.set_mail(user_list[3]) u.set_security(sec.get_by_name(user_list[4])) return u
def new_user(): u = User() u.set_id(random.randint(1, 999)) u.set_username(input("Nutzername: ")) u.set_password(input("Passwort: ")) u.set_mail(input("Mail: ")) for i in range(len(sec.secs)): print(str(i + 1) + " | " + sec.secs[i].name) which = int(input("Wählen sie eine Sicherheitsstufe: ")) u.set_security(sec.secs[which - 1].name) save_user(u) return u