College flag may apply to students and teachers
authorBill Erickson <berickxx@gmail.com>
Tue, 18 Sep 2018 17:27:58 +0000 (10:27 -0700)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Ensure the --college flag is set for both students and teachers when
importing college student/teacher accounts

Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/utility-scripts/import_students/sftp-client-agent.sh

index c9017c5..eb0f73a 100755 (executable)
@@ -181,16 +181,17 @@ for code in "${CODES_TO_PROCESS[@]}"; do
 
             announce "Inspecting file $FILE"
 
+            if [[ " ${COLLEGE_CODES[@]} " =~ " $code " ]]; then
+                announce "Processing a college district code"
+                COLLEGE_FLAG="--college"
+             fi
+
             # File format examples:
             # 415.2016-03-18.csv
             # 415.teacher.2016-03-18.csv
             if [[ $LOCAL_FILE =~ ^[0-9a-z]{3}.[0-9]{4}-[0-9]{2}-[0-9]{2}.csv$ ]]; then
                 announce "Found a student file."
 
-                if [[ " ${COLLEGE_CODES[@]} " =~ " $code " ]]; then
-                    announce "Processing a college student file"
-                    COLLEGE_FLAG="--college"
-                fi
             else
                 if [[ $LOCAL_FILE =~ ^[0-9a-z]{3}.teacher.[0-9]{4}-[0-9]{2}-[0-9]{2}.csv$ ]]; then
                     announce "Found a teacher file."