From 9fb095b7c6f8ab1206b03b5e91dd711e79038881 Mon Sep 17 00:00:00 2001 From: profitroll Date: Fri, 16 Dec 2022 11:27:56 +0100 Subject: [PATCH] application_approved() method added --- classes/holo_user.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/classes/holo_user.py b/classes/holo_user.py index 2e3b536..c0879f0 100644 --- a/classes/holo_user.py +++ b/classes/holo_user.py @@ -274,6 +274,14 @@ class HoloUser(): else: return tmp_application["state"], tmp_application["complete"] + def application_approved(self) -> bool: + """Check whether user has a completed application and it got approved + + ### Returns: + * `bool`: `True` if yes and `False` if no + """ + return True if col_applications.find_one({"user": self.id}) is not None else False + def application_restart(self) -> None: """Reset application of a user in tmp collection and replace it with an empty one """