fixing issues related to datatypes

This commit is contained in:
Gowtham Sai 2022-09-20 01:34:27 +05:30
parent 7a740b56f1
commit 75f7afd151
1 changed files with 2 additions and 2 deletions

View File

@ -368,7 +368,7 @@ def addPPO(request, id, email, user_type):
data = request.data data = request.data
PPO = PrePlacementOffer() PPO = PrePlacementOffer()
PPO.company = data[COMPANY_NAME] PPO.company = data[COMPANY_NAME]
PPO.compensation = data[COMPENSATION_GROSS] PPO.compensation = int(data[COMPENSATION_GROSS])
if data[OFFER_ACCEPTED] == "true": if data[OFFER_ACCEPTED] == "true":
PPO.accepted = True PPO.accepted = True
elif data[OFFER_ACCEPTED] == "false": elif data[OFFER_ACCEPTED] == "false":
@ -377,7 +377,7 @@ def addPPO(request, id, email, user_type):
PPO.accepted = None PPO.accepted = None
PPO.student = get_object_or_404(Student, id=data[STUDENT_ID]) PPO.student = get_object_or_404(Student, id=data[STUDENT_ID])
PPO.designation = data[DESIGNATION] PPO.designation = data[DESIGNATION]
PPO.tier = data[TIER] PPO.tier = int(data[TIER])
if COMPENSATION_DETAILS in data: if COMPENSATION_DETAILS in data:
PPO.compensation_details = data[COMPENSATION_DETAILS] PPO.compensation_details = data[COMPENSATION_DETAILS]
PPO.changed_by = get_object_or_404(User, id=id) PPO.changed_by = get_object_or_404(User, id=id)