From f57d4859f36069e967d8ee6a5530db6917f722c0 Mon Sep 17 00:00:00 2001 From: kaiyou Date: Thu, 8 Nov 2018 20:30:41 +0100 Subject: [PATCH] Provide an in-context wrapper for getting users --- core/admin/mailu/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/admin/mailu/models.py b/core/admin/mailu/models.py index bc1044db..22839e3b 100644 --- a/core/admin/mailu/models.py +++ b/core/admin/mailu/models.py @@ -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)