Provide an in-context wrapper for getting users
This commit is contained in:
@@ -349,6 +349,10 @@ class User(Base, Email):
|
||||
self.sendmail(app.config["WELCOME_SUBJECT"],
|
||||
app.config["WELCOME_BODY"])
|
||||
|
||||
@classmethod
|
||||
def get(cls, email):
|
||||
return cls.query.get(email)
|
||||
|
||||
@classmethod
|
||||
def login(cls, email, password):
|
||||
user = cls.query.get(email)
|
||||
|
||||
Reference in New Issue
Block a user