-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuserData.py
More file actions
37 lines (28 loc) · 841 Bytes
/
userData.py
File metadata and controls
37 lines (28 loc) · 841 Bytes
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
class UserData:
'''
class to create new user accounts
'''
create_account = []
def __init__(self, firstName, lastName, email, username, password):
"""
Initializes the class
"""
self.firstName = firstName
self.lastName = lastName
self.email = email
self.username = username
self.password = password
def save_account(self):
"""
saves the new user to create_account list
"""
UserData.create_account.append(self)
@classmethod
def user_login(cls, used_name, used_password):
"""
checks whether user exists
"""
for user in UserData.create_account:
if user.username == used_name and user.password == used_password:
return user
return False