From d4c269af9dc77a904001196432534f367e6df940 Mon Sep 17 00:00:00 2001 From: Tyler Lightwood Date: Thu, 8 Feb 2024 12:36:44 +0000 Subject: [PATCH 1/2] Fixed exit error - Fixed error when compiled where if user exits the admin dashboard, error is thrown due to wrong use of exit --- .gitignore | 1 + admin_dashboard.py | 3 ++- requirements.txt | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 62f26ca..1d53123 100644 --- a/.gitignore +++ b/.gitignore @@ -163,3 +163,4 @@ cython_debug/ audit_log.txt config.ini +.vscode/settings.json diff --git a/admin_dashboard.py b/admin_dashboard.py index 1bea334..5c4783e 100644 --- a/admin_dashboard.py +++ b/admin_dashboard.py @@ -1,4 +1,5 @@ import time +import sys from colorama import Fore, Style from common_functions import clear_screen, log_action from user_management import user_management @@ -28,7 +29,7 @@ def admin_dashboard(): print("\nLogging out...") log_action("ADMIN", "Logged Out") time.sleep(2) - exit() + sys.exit() else: print(Fore.RED + "\nInvalid option. Please try again." + Style.RESET_ALL) time.sleep(2) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index e4b8602..21f8f55 100644 --- a/requirements.txt +++ b/requirements.txt @@ -107,4 +107,4 @@ Werkzeug==3.0.1 wheel==0.42.0 whichcraft==0.6.1 zope.event==5.0 -zope.interface==6.1 \ No newline at end of file +zope.interface==6.1 From ef52432a35de3195e0bc1868b1cc3a9be3fcf798 Mon Sep 17 00:00:00 2001 From: Tyler Lightwood Date: Thu, 8 Feb 2024 12:38:54 +0000 Subject: [PATCH 2/2] Fixed exit issue --- sudo_user_login.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sudo_user_login.py b/sudo_user_login.py index 5904ea7..6d1590f 100644 --- a/sudo_user_login.py +++ b/sudo_user_login.py @@ -1,4 +1,5 @@ import time +import sys import getpass from common_functions import clear_screen, verify_password, log_action from colorama import Fore, Style @@ -51,7 +52,7 @@ def attempt_login(self, username, password, attempts): return username else: self.print_insufficient_clearance(username) - exit() + sys.exit() else: self.print_incorrect_password(username, attempts) else: