summaryrefslogtreecommitdiff
path: root/opendc/models/user.py
diff options
context:
space:
mode:
authorGeorgios Andreadis <info@gandreadis.com>2020-06-25 17:11:03 +0200
committerGeorgios Andreadis <info@gandreadis.com>2020-06-25 17:11:03 +0200
commitc0bf71322e4fd510046588e388ada0a81f54631d (patch)
tree7f0af5b0657558a4730b62298534cd6a1d829765 /opendc/models/user.py
parentcae7ee8ab4639963d3da7fef6f078a6078340a0b (diff)
Implement and test path
Diffstat (limited to 'opendc/models/user.py')
-rw-r--r--opendc/models/user.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/opendc/models/user.py b/opendc/models/user.py
index bbbb40e8..ea8b1f3f 100644
--- a/opendc/models/user.py
+++ b/opendc/models/user.py
@@ -10,6 +10,10 @@ class User(Model):
def from_email(cls, email):
return User(DB.fetch_one({'email': email}, User.collection_name))
+ @classmethod
+ def from_google_id(cls, google_id):
+ return User(DB.fetch_one({'googleId': google_id}, User.collection_name))
+
def validate(self, request_google_id=None):
super_validation = super().validate(request_google_id)