diff --git a/models/HabitList.py b/models/HabitList.py index 110af65..e20ac25 100644 --- a/models/HabitList.py +++ b/models/HabitList.py @@ -62,7 +62,10 @@ class HabitList: # Adds a User by email to the HabitList def add_user(self, email: str): user = User.get_by_email(email) - add_user(self.id, user.id) + if user: + add_user(self.id, user.id) + else: + return None # Removes a User from the HabitList