Merge pull request #193 from CDC-IITDH/fix-validation

fix tier validation
This commit is contained in:
karthik mv 2023-11-29 23:08:05 +05:30 committed by GitHub
commit b3f9e2835d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -252,10 +252,14 @@ def PlacementApplicationConditions(student, placement):
for i in selected_companies: for i in selected_companies:
if int(i.placement.tier) != 1 and int(i.placement.tier) <= int(placement.tier): if int(i.placement.tier) != 1 and int(i.placement.tier) <= int(placement.tier):
return False, "Can't apply for this tier" return False, "Can't apply for this tier"
elif int(i.placement.tier) == 1 and int(placement.tier) != 1:
return False, "Can't apply for this tier"
for i in PPO: for i in PPO:
if int(i.tier) != 1 and int(i.tier) <= int(placement.tier): if int(i.tier) != 1 and int(i.tier) <= int(placement.tier):
return False, "Can't apply for this tier" return False, "Can't apply for this tier"
elif int(i.tier) == 1 and int(placement.tier) != 1:
return False, "Can't apply for this tier"
if student.degree != 'bTech' and not placement.rs_eligible: if student.degree != 'bTech' and not placement.rs_eligible:
raise PermissionError("Can't apply for this placement") raise PermissionError("Can't apply for this placement")