Refactor the users class into their own files, add a common base class for federated users and add a verify_credentials
method which only does the verification, without the linking. We use this in the superuser verification pass
This commit is contained in:
parent
1245385808
commit
33b54218cc
13 changed files with 541 additions and 495 deletions
18
data/users/database.py
Normal file
18
data/users/database.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
from data import model
|
||||
|
||||
class DatabaseUsers(object):
|
||||
def verify_credentials(self, username_or_email, password):
|
||||
""" Simply delegate to the model implementation. """
|
||||
result = model.user.verify_user(username_or_email, password)
|
||||
if not result:
|
||||
return (None, 'Invalid Username or Password')
|
||||
|
||||
return (result, None)
|
||||
|
||||
def verify_and_link_user(self, username_or_email, password):
|
||||
""" Simply delegate to the model implementation. """
|
||||
return self.verify_credentials(username_or_email, password)
|
||||
|
||||
def confirm_existing_user(self, username, password):
|
||||
return self.verify_credentials(username, password)
|
||||
|
Reference in a new issue