Skip to content

Commit

Permalink
Merge pull request #57 from narain280493/iter4
Browse files Browse the repository at this point in the history
bug fix while returning proj preference of unassigned students.
  • Loading branch information
narain280493 authored Dec 8, 2016
2 parents 8ac34e2 + a881ac3 commit 3935c17
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ def filterApplications():
overridenProjList = []
overridenprojPrefList = []
rejectStudents = []
rejectStudentsProjPrefList = []


## get re-assigned projects and students here
Expand All @@ -390,18 +391,24 @@ def filterApplications():
firstName = sJson['FirstName']
lastName = sJson['LastName']
name = firstName + lastName
stuApp = studentapplication.query.filter_by(s_id=sJson['id']).first()
saJson = saSchema.dump(obj=stuApp).data

if gpa < u'3':
rejectStudents.append(sJson)
rejectStudentsProjPrefList.append(saJson)
continue
elif isWorkedBefore == True:
rejectStudents.append(sJson)
rejectStudentsProjPrefList.append(saJson)
continue
elif isAvailability == 'Not sure' or isAvailability == 'No':
rejectStudents.append(sJson)
rejectStudentsProjPrefList.append(saJson)
continue
elif isMSBSStudent == 'Yes':
rejectStudents.append(sJson)
rejectStudentsProjPrefList.append(saJson)
continue
else:
sJson['Race'] = json.loads(sJson['Race'])
Expand Down Expand Up @@ -467,7 +474,7 @@ def filterApplications():
data['projectPreference'] = assignedStudentProjPreferenceList
data['unassignedProject'] = unassignedProjects
data['unassignedStudent'] = unassignedStudents
data['unassignedStudentProjPrefences'] = unassignedStudentProjPreferenceList
data['unassignedStudentProjPrefences'] = unassignedStudentProjPreferenceList + rejectStudentsProjPrefList
json_data = json.dumps(data)

return json_data
Expand Down

0 comments on commit 3935c17

Please sign in to comment.