Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update departments account and org from Tracy. #406

Open
wants to merge 3 commits into
base: development
Choose a base branch
from

Conversation

tylerpar99
Copy link
Member

This fixed PR #378

Summary: This PR changes the file updateStudentRecords.py to updateDBRecords.py. We then add to that file a count of failed and updated department codes. In userInsertFunctions.py we add a new function that will update all department account and org codes based on what Tracy has for that department name. We also added a new function to Tracy to get department data from a department name and return the account and org code. We also added to the test suite to include the new department updating function and updated a test that resulted from adding a new department to UTE.

To Test: Run the test suite. Reset from-backup and export flask environment to staging. Not in the terminal type "python updateDBRecords.py" and you will see that some fail and some pass. Fails are from departments that no longer exist. Success proves that the new function updates departments.

Tracy data.
"""
studentsInDB = Student.select()
supervisorsInDB = Supervisor.select()
departmentsFromDB = Department.select()
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a blocker and really nitpicky but I think it would be nice to keep naming the same on all of these so it would be departmentsInDB

Copy link
Contributor

Choose a reason for hiding this comment

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

agreed!

Copy link
Contributor

@sreynit02 sreynit02 left a comment

Choose a reason for hiding this comment

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

Just one easy comment to resolve. After that you're all set!

Tracy data.
"""
studentsInDB = Student.select()
supervisorsInDB = Supervisor.select()
departmentsFromDB = Department.select()
Copy link
Contributor

Choose a reason for hiding this comment

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

agreed!

@@ -91,6 +91,13 @@ def getDepartments(self):
return STUPOSN.query.with_entities(STUPOSN.ORG, STUPOSN.DEPT_NAME, STUPOSN.ACCOUNT) \
.distinct().order_by(STUPOSN.DEPT_NAME).all()

def getDepartmentsFromName(self, deptName):
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

You might consider correcting the name of the function. getDepartmentsFromName implies that you are getting multiple departments, which is not true.

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.

5 participants