From 40a3bbaa24284a2804680d7d3a92252f3ff73b47 Mon Sep 17 00:00:00 2001 From: Michael Kaiser Date: Thu, 23 Nov 2023 17:37:28 +0100 Subject: [PATCH] renaming of classes and files in frontend --- codeGrader/frontend/admin/app.py | 12 ++++++------ .../{SessionAdminUser.py => SessionAdmin.py} | 6 +++--- codeGrader/frontend/admin/handlers/__init__.py | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) rename codeGrader/frontend/admin/handlers/{SessionAdminUser.py => SessionAdmin.py} (87%) diff --git a/codeGrader/frontend/admin/app.py b/codeGrader/frontend/admin/app.py index 20807b6..0467c86 100644 --- a/codeGrader/frontend/admin/app.py +++ b/codeGrader/frontend/admin/app.py @@ -7,7 +7,7 @@ from flask_login import LoginManager, login_user, login_required, logout_user from codeGrader.frontend.config import config from codeGrader.frontend.admin import templates -from codeGrader.frontend.admin.handlers import AdminUserLoginHandler, AdminUserSessionHandler, SessionAdminUser, \ +from codeGrader.frontend.admin.handlers import AdminUserLoginHandler, AdminSessionHandler, SessionAdmin, \ UserListHandler, UserHandler, HomeHandler, AdminListHandler, AdminHandler, ProfileListHandler, \ ProfileHandler, SubjectListHandler, SubjectHandler, TaskHandler, TaskListHandler, ExerciseHandler, \ ExerciseListHandler, AddAdminHandler, AddProfileHandler, AddUserHandler, AddTaskHandler, AddExerciseHandler, \ @@ -22,16 +22,16 @@ @login_manager.user_loader -def adminUser_login(adminUser_id): +def adminUser_login(admin_id): """ User load of the login_manager Returns the frontend represenation of the user - @param adminUser_id: the id of the user - @type adminUser_id: int + @param admin_id: the id of the user + @type admin_id: int @return: The frontend User Object - @rtype: SessionAdminUser + @rtype: SessionAdmin """ - user = SessionAdminUser(adminUser_id) + user = SessionAdmin(admin_id) return user diff --git a/codeGrader/frontend/admin/handlers/SessionAdminUser.py b/codeGrader/frontend/admin/handlers/SessionAdmin.py similarity index 87% rename from codeGrader/frontend/admin/handlers/SessionAdminUser.py rename to codeGrader/frontend/admin/handlers/SessionAdmin.py index 2c3418d..44beb9e 100644 --- a/codeGrader/frontend/admin/handlers/SessionAdminUser.py +++ b/codeGrader/frontend/admin/handlers/SessionAdmin.py @@ -8,7 +8,7 @@ import json -class SessionAdminUser(UserMixin): +class SessionAdmin(UserMixin): """ Representation of a AdminUser used for the CookieGeneration. """ @@ -19,13 +19,13 @@ def __init__(self, adminUser_id): @param adminUser_id: The """ - user_dict = AdminUserSessionHandler().get(adminUser_id) + user_dict = AdminSessionHandler().get(adminUser_id) self.id = user_dict["id"] self.username = user_dict["username"] profile = user_dict["profile"] -class AdminUserSessionHandler(BaseHandler): +class AdminSessionHandler(BaseHandler): """ UserHandler Handles all the operations that can be done on a User in the backend diff --git a/codeGrader/frontend/admin/handlers/__init__.py b/codeGrader/frontend/admin/handlers/__init__.py index 9a33b65..f902507 100644 --- a/codeGrader/frontend/admin/handlers/__init__.py +++ b/codeGrader/frontend/admin/handlers/__init__.py @@ -4,7 +4,7 @@ """ from .Login import AdminUserLoginHandler -from .SessionAdminUser import AdminUserSessionHandler, SessionAdminUser +from .SessionAdmin import AdminSessionHandler, SessionAdmin from .User import UserListHandler, UserHandler, AddUserHandler from .Home import HomeHandler from .AdminUser import AdminListHandler, AdminHandler, AddAdminHandler @@ -13,7 +13,7 @@ from .Task import TaskHandler, TaskListHandler, AddTaskHandler from .Exercise import ExerciseHandler, ExerciseListHandler, AddExerciseHandler -__all__ = ["AdminUserLoginHandler", "AdminUserSessionHandler", "SessionAdminUser", "UserListHandler", "UserHandler", +__all__ = ["AdminUserLoginHandler", "AdminSessionHandler", "SessionAdmin", "UserListHandler", "UserHandler", "HomeHandler", "AdminHandler", "AdminListHandler", "ProfileListHandler", "ProfileHandler", "SubjectListHandler", "SubjectHandler", "ExerciseListHandler", "ExerciseHandler", "TaskHandler", "TaskListHandler", "AddAdminHandler", "AddProfileHandler", "AddExerciseHandler", "AddTaskHandler",