-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: development
Are you sure you want to change the base?
Conversation
app/logic/userInsertFunctions.py
Outdated
Tracy data. | ||
""" | ||
studentsInDB = Student.select() | ||
supervisorsInDB = Supervisor.select() | ||
departmentsFromDB = Department.select() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed!
There was a problem hiding this 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!
app/logic/userInsertFunctions.py
Outdated
Tracy data. | ||
""" | ||
studentsInDB = Student.select() | ||
supervisorsInDB = Supervisor.select() | ||
departmentsFromDB = Department.select() |
There was a problem hiding this comment.
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): | |||
""" |
There was a problem hiding this comment.
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.
This fixed PR #378
Summary: This PR changes the file
updateStudentRecords.py
toupdateDBRecords.py
. We then add to that file a count of failed and updated department codes. InuserInsertFunctions.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.