oicd now working
This commit is contained in:
@@ -59,9 +59,12 @@ class User(UserMixin, db.Model):
|
||||
backref=db.backref('followers', lazy='dynamic'),
|
||||
lazy='dynamic')
|
||||
|
||||
def __init__(self, email, password):
|
||||
self.email = email
|
||||
self.password = sha256_crypt.encrypt(password)
|
||||
def __init__(self, **kwargs):
|
||||
super(User, self).__init__(**kwargs)
|
||||
password = kwargs.get("password", None)
|
||||
if password is not None:
|
||||
self.password = sha256_crypt.encrypt(password)
|
||||
# do custom initialization here
|
||||
|
||||
@staticmethod
|
||||
def get_by_identifier(identifier):
|
||||
@@ -71,7 +74,8 @@ class User(UserMixin, db.Model):
|
||||
:return:
|
||||
"""
|
||||
return User.query.filter(or_(User.nickname == identifier,
|
||||
User.email == identifier)).first()
|
||||
User.email == identifier),
|
||||
User.id == identifier).first()
|
||||
|
||||
@staticmethod
|
||||
def get_all():
|
||||
|
||||
Reference in New Issue
Block a user