Provide an in-context wrapper for getting users

This commit is contained in:
kaiyou
2018-11-08 20:30:41 +01:00
parent f6013aa29f
commit f57d4859f3

View File

@@ -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)