Provide an in-context wrapper for getting users

master
kaiyou 6 years ago
parent f6013aa29f
commit f57d4859f3

@ -349,6 +349,10 @@ class User(Base, Email):
self.sendmail(app.config["WELCOME_SUBJECT"], self.sendmail(app.config["WELCOME_SUBJECT"],
app.config["WELCOME_BODY"]) app.config["WELCOME_BODY"])
@classmethod
def get(cls, email):
return cls.query.get(email)
@classmethod @classmethod
def login(cls, email, password): def login(cls, email, password):
user = cls.query.get(email) user = cls.query.get(email)

Loading…
Cancel
Save