From be8c2955ced0c41379f5cd98ac4bc3f93006cf47 Mon Sep 17 00:00:00 2001 From: Marek Wolan Date: Wed, 9 Aug 2023 10:26:52 +0100 Subject: [PATCH] Change Accountstatus to a bool --- src/primaite/simulator/domain/account.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/primaite/simulator/domain/account.py b/src/primaite/simulator/domain/account.py index 2d726624..79d0de23 100644 --- a/src/primaite/simulator/domain/account.py +++ b/src/primaite/simulator/domain/account.py @@ -17,13 +17,6 @@ class AccountType(Enum): "User accounts are used to allow agents to log in and perform actions" -class AccountStatus(Enum): - """Whether the account is active.""" - - ENABLED = 1 - DISABLED = 2 - - class PasswordPolicyLevel(Enum): """Complexity requirements for account passwords.""" @@ -47,7 +40,7 @@ class Account(SimComponent): "Account password." account_type: AccountType "Account Type, currently this can be service account (used by apps) or user account." - status: AccountStatus = AccountStatus.DISABLED + enabled: bool = True def describe_state(self) -> Dict: """Describe state for agent observations.""" @@ -55,11 +48,11 @@ class Account(SimComponent): def enable(self): """Set the status to enabled.""" - self.status = AccountStatus.ENABLED + self.enabled = True def disable(self): """Set the status to disabled.""" - self.status = AccountStatus.DISABLED + self.enabled = False def log_on(self) -> None: """TODO."""