Removed the ability for duplicate accounts being able to be made
This commit is contained in:
parent
c6ef411930
commit
08479c1134
@ -23,6 +23,10 @@ class DatabaseController(ABC):
|
||||
setattr(obj, attr, value)
|
||||
return obj
|
||||
|
||||
"""
|
||||
Set of CRUD methods to allow for Data manipulation on the backend
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def create(self):
|
||||
pass
|
||||
|
@ -49,6 +49,12 @@ def display_signup(error: str = None):
|
||||
@blueprint.post('/signup')
|
||||
def signup():
|
||||
database = UserController()
|
||||
|
||||
# User already exists
|
||||
if database.read(request.form['username']) != None:
|
||||
error = "User, " + request.form['username'] + " already exists"
|
||||
return display_signup(error)
|
||||
|
||||
database.create(Customer(
|
||||
0,
|
||||
request.form['username'],
|
||||
@ -64,6 +70,7 @@ def signup():
|
||||
return redirect("/login", code=307)
|
||||
|
||||
|
||||
### SIGN OUT FUNCTIONALITY
|
||||
# Function responsible for handling logouts from the site
|
||||
@blueprint.route('/logout')
|
||||
def logout():
|
||||
|
Loading…
Reference in New Issue
Block a user