diff --git a/app/models/user.py b/app/models/user.py index 4796811..5c5fc8d 100644 --- a/app/models/user.py +++ b/app/models/user.py @@ -25,12 +25,17 @@ class User(UserMixin): self.password_hash = password_hash self.role = role self.product_ids = product_ids or [] - self.is_active = is_active + self._is_active = is_active def get_id(self): """Get user ID for Flask-Login""" return self.user_id + @property + def is_active(self): + """Check if user account is active (Flask-Login property)""" + return self._is_active + @property def is_authenticated(self): """Check if user is authenticated""" @@ -78,7 +83,7 @@ class User(UserMixin): 'password_hash': self.password_hash, 'role': self.role, 'product_ids': self.product_ids, - 'is_active': self.is_active + 'is_active': self._is_active } @classmethod