From 3d3584ab8e5fc7ca55553517498ea85b85c42f80 Mon Sep 17 00:00:00 2001 From: karthikmurakonda Date: Wed, 29 Nov 2023 23:05:55 +0530 Subject: [PATCH] fix tier validation --- CDC_Backend/APIs/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CDC_Backend/APIs/utils.py b/CDC_Backend/APIs/utils.py index 3c626ba..3d87410 100644 --- a/CDC_Backend/APIs/utils.py +++ b/CDC_Backend/APIs/utils.py @@ -252,10 +252,14 @@ def PlacementApplicationConditions(student, placement): for i in selected_companies: if int(i.placement.tier) != 1 and int(i.placement.tier) <= int(placement.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: if int(i.tier) != 1 and int(i.tier) <= int(placement.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: raise PermissionError("Can't apply for this placement")