Skip to content

Tracy dependency#566

Open
MImran2002 wants to merge 10 commits intodevelopmentfrom
tracyDependency
Open

Tracy dependency#566
MImran2002 wants to merge 10 commits intodevelopmentfrom
tracyDependency

Conversation

@MImran2002
Copy link
Copy Markdown
Contributor

@MImran2002 MImran2002 commented Mar 4, 2026

Issue number: #533

Issue Description: Now that we have an update script that runs frequently, we don't need to check the external tracy database during regular application usage. We should remove the dependency and just use the data that we have locally.
There should be a sanity check, though, to make sure there aren't valid reasons to be checking with Tracy outside of the update script.

Tracy Codes Changed:

  • App> login_manager> require_login(): user
  • App> logic> adminManagement.py> searchForAdmin(): tracyStudents > databaseStudents; tracySupervisors > databaseSupervisors
  • App> controllers> main_routes> laborStatusForm.py> laborStatusForm: students, terms, staffs, departments
  • App> controller> main_routes> laborStatusForm.py > userInsert: students, supervisor
  • App> controller> main_routes> laborStatusForm.py > getPositions: positions
  • App> controller> main_routes> laborStatusForm.py > releaseAndRehire: student, supervisor
  • App> logic> allPendingForms.py> overrideOriginalStatusFormOnAdjustmentFormApproval(): position
  • App> logic> allPendingForms.py> modal_approval_and_denial_data(): position
  • App> logic> allPendingForms.py> checkAdjustment(): newPosition
  • App> logic> emailHandler.py> init(): newSupervisor, currentPosition, newPosition
  • App> controller> main_routes> search.py> search(): current_students, current_students
  • App> controllers> main_routes> laborHistory.py> populateModal(): newPosition, oldPosition
  • App> controllers> main_routes> alterLSF.py> alterLSF()
  • App> controllers> main_routes> alterLSF.py> fetchPositions
  • App> logic> alterLSF.py> modifyLSF()
  • App> controller> main_routes> laborStatusForm.py > getPositions
  • Moved functions in app> logic> departmentPositions.py> updatePositionRecords() to userInsertFunctions.py

Tracy Codes Not Changed:

  • App> controllers> main_routes> alterLSF.py> alterLSF(): oldSupervisors (Because there is a sanity chewck)
  • App> login_manager> auth_user(): student, supervisors because of shibboleth
  • App> logic> adminManagement.py> getuser(): student, supervisor and usertype because there is a sanity check on whether user exist in the database
  • App> logic> allPendingForms.py> overrideOriginalStatusFormOnAdjustmentFormApproval(): tracyuser is kept because there is a sanity check on user in database
  • App> logic> allPendingForms.py> checkAdjustment(): newSupervisor because there is a sanity check

TestCase added for (These test are created because getting position have complex peewee in it):

  • App> controllers> main_routes> alterLSF.py> alterLSF()
  • App> controllers> main_routes> alterLSF.py> fetchPositions:
  • App> logic> alterLSF.py> modifyLSF():
  • App> controller> main_routes> laborStatusForm.py > getPositions:

Codes changed:
All of the code changed are through replacing Tracy functions and Tracy calls with Peewee calls

UI Testing:

  • App> login_manager> require_login(): print the user in the terminal and click log out in the UI to test
  • App> logic> adminManagement.py> searchForAdmin(): Go to Sidebar > Administration > manage Administrators > Labor Administrator click the drop down and admins should be populated when you search (The same with SAAS and Fin Aid Admin)
  • App> controllers> main_routes> laborStatusForm.py> laborStatusForm:
    Go to the sidebar > New Labor Status Form > Select either Supervisor, Department, Terms and Students (You might need to create a term in administration> manage terms to create LSF form)
  • App> controller> main_routes> laborStatusForm.py > userInsert:
    Go to the sidebar > New Labor Status Form > Create a labor Status Form > Add Student > Review > A modal pop up > Click Submit (You might need to create a term in administration> manage terms to create LSF form)
  • App> controller> main_routes> laborStatusForm.py > getPositions: Go to the sidebar > New Labor Status Form > Create a labor Status Form > Select Position (WLS) to see if its working (You might need to create a term in administration> manage terms to create LSF form)
  • App> logic> emailHandler.py> init(): Trigger any event like creating a new Labor Status Form that will involve an inititation of the emailhandler class
  • App> controller> main_routes> search.py> search(): This can be checked through Sidebar > Student Search > Search any student
  • App> controllers> main_routes> laborHistory.py> populateModal(): Side Bar > Labor Status Form > Create labor status form that is aimed to create the same position for the same term to recreate an error that involves both old position and new position

… called and in the script updateDBRecords.py the functions like updatePositionsRecords which orignally exist in departmentpositions are called to a different file called userInsertFuncitons.py so it just moving functions to a correct file.
@ojmakinde ojmakinde self-requested a review March 4, 2026 20:11

# Update the user's name
user = updateUserFromTracy(user)
user = User.get(User.userID == user.userID)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to get the user object again, because it is initialized by the call to auth_user

STU_EMAIL="imran@berea.edu"
)
supervisor1 = Supervisor.get_or_none(Supervisor.ID == "B12361007")
if supervisor1 is None:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we don't check other entries before creating, our test will fail if duplicate data exists (which is ok). Since it's already going to fail, we don't need to get_or_none and check for supervisor existence.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getting the active positions should happen from Tracy, not LaborStatusForms. We should also name this script with a verb, like updateActivePositions. WE probably also want to do the department update in this script, since they are pulling from the same table and dept should be updated before active positions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants