-
Notifications
You must be signed in to change notification settings - Fork 0
526 contrasting confirmation messages #571
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
base: development
Are you sure you want to change the base?
Changes from all commits
8a298fd
64e7ca0
9240ee6
8df780e
3ae3aa1
c38d7f4
9d6e22e
ed91c50
d60854f
7c0fd6a
272930d
2768210
5ab735a
adf5658
1091882
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,41 +57,43 @@ def createOverloadFormAndFormHistory(rspFunctional, lsf, creatorID, host=None): | |
| """ | ||
| # We create a 'Labor Status Form' first, then we check to see if a 'Labor Overload Form' | ||
| # needs to be created | ||
| isOverload = rspFunctional.get("isItOverloadForm") == "True" | ||
| if isOverload: | ||
| newLaborOverloadForm = OverloadForm.create( studentOverloadReason = None, | ||
| financialAidApproved = None, | ||
| financialAidApprover = None, | ||
| financialAidReviewDate = None, | ||
| SAASApproved = None, | ||
| SAASApprover = None, | ||
| SAASReviewDate = None, | ||
| laborApproved = None, | ||
| laborApprover = None, | ||
| laborReviewDate = None) | ||
| formOverload = FormHistory.create( formID = lsf.laborStatusFormID, | ||
| historyType = "Labor Overload Form", | ||
| overloadForm = newLaborOverloadForm.overloadFormID, | ||
| createdBy = creatorID, | ||
| createdDate = date.today(), | ||
| status = "Pre-Student Approval") | ||
| email = emailHandler(formOverload.formHistoryID) | ||
| link = makeThirdPartyLink("student", host, formOverload.formHistoryID) | ||
| email.LaborOverLoadFormSubmitted(link) | ||
|
|
||
| formHistory = FormHistory.create( formID = lsf.laborStatusFormID, | ||
| historyType = "Labor Status Form", | ||
| overloadForm = None, | ||
| createdBy = creatorID, | ||
| createdDate = date.today(), | ||
| status = "Pre-Student Approval") | ||
| try: | ||
| isOverload = rspFunctional.get("isItOverloadForm") == "True" | ||
| if isOverload: | ||
| newLaborOverloadForm = OverloadForm.create( studentOverloadReason = None, | ||
| financialAidApproved = None, | ||
| financialAidApprover = None, | ||
| financialAidReviewDate = None, | ||
| SAASApproved = None, | ||
| SAASApprover = None, | ||
| SAASReviewDate = None, | ||
| laborApproved = None, | ||
| laborApprover = None, | ||
| laborReviewDate = None) | ||
| formOverload = FormHistory.create( formID = lsf.laborStatusFormID, | ||
| historyType = "Labor Overload Form", | ||
| overloadForm = newLaborOverloadForm.overloadFormID, | ||
| createdBy = creatorID, | ||
| createdDate = date.today(), | ||
| status = "Pre-Student Approval") | ||
| email = emailHandler(formOverload.formHistoryID) | ||
| link = makeThirdPartyLink("student", host, formOverload.formHistoryID) | ||
| email.LaborOverLoadFormSubmitted(link) | ||
|
|
||
| if not formHistory.formID.termCode.isBreak and not isOverload: | ||
| email = emailHandler(formHistory.formHistoryID) | ||
| email.laborStatusFormSubmitted() | ||
| formHistory = FormHistory.create( formID = lsf.laborStatusFormID, | ||
| historyType = "Labor Status Form", | ||
| overloadForm = None, | ||
| createdBy = creatorID, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't the email.laborStatusFormSubmitted be here?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the call is intentionally handled later in the flow. For overload forms, the email is triggered earlier on line 81 via email.LaborOverloadFormSubmitted(link) and for regular status forms, the emaila gets sent on line 91 after the FormHistory record is created. |
||
| createdDate = date.today(), | ||
| status = "Pre-Student Approval") | ||
|
|
||
| return formHistory | ||
| if not formHistory.formID.termCode.isBreak and not isOverload: | ||
| email = emailHandler(formHistory.formHistoryID) | ||
|
|
||
| return formHistory | ||
| except Exception as e: | ||
| print("Error creating overload form:", e) | ||
| raise | ||
|
|
||
|
|
||
| def checkForSecondLSFBreak(termCode, student): | ||
|
|
@@ -223,13 +225,18 @@ def emailDuringBreak(secondLSFBreak, term): | |
| """ | ||
| Sending emails during break period | ||
| """ | ||
| if term.isBreak: | ||
| isOneLSF = json.loads(secondLSFBreak) | ||
| formHistory = FormHistory.get(FormHistory.formHistoryID == isOneLSF['formHistoryID']) | ||
| email = emailHandler(formHistory.formHistoryID) | ||
| email.laborStatusFormSubmitted() | ||
| if(len(isOneLSF["previousSupervisorNames"]) > 1): #Student has more than one lsf. Send email to both supervisors and student | ||
| email.notifyAdditionalLaborStatusFormSubmittedForBreak() | ||
| try: | ||
| if term.isBreak: | ||
| isOneLSF = json.loads(secondLSFBreak) | ||
| formHistory = FormHistory.get(FormHistory.formHistoryID == isOneLSF['formHistoryID']) | ||
| email = emailHandler(formHistory.formHistoryID) | ||
| email.laborStatusFormSubmitted() | ||
| if(len(isOneLSF["previousSupervisorNames"]) > 1): #Student has more than one lsf. Send email to both supervisors and student | ||
| email.notifyAdditionalLaborStatusFormSubmittedForBreak() | ||
| except Exception as e: | ||
| print("Error sending email during break:", e) | ||
| raise | ||
|
|
||
|
|
||
|
|
||
| def createOverloadForm(newWeeklyHours, lsf, currentUser, adjustedForm=None, formHistories=None, host=None): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| from app import app | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can I know the rationale for this as working on init.py file affect most of the backend
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added these lines to resolve a circular import issue where other files depended on the db instance from this file. At the time, those modules were being imported before the database had been properly initialized, which led to errors when accessing db. Importing the Flask app and initializing db with it ensured that the database instance was available when those modules were loaded. |
||
| import os | ||
|
|
||
| from peewee import * | ||
| from flask_sqlalchemy import SQLAlchemy | ||
| db = SQLAlchemy(app) | ||
|
|
||
| from app import app | ||
|
|
||
| def getMySQLDB(): | ||
| if os.environ.get("USING_CONTAINER", False): | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.