Compare commits

..

1 Commits

Author SHA1 Message Date
Jaya Surya P efcc72c50e
Merge c2ebf5a600 into 18f509e6a4 2024-07-28 14:11:23 +00:00
5 changed files with 23 additions and 27 deletions

View File

@ -84,8 +84,10 @@ def addPlacement(request):
# Add a contact person details in the opening
opening.contact_person_name = data[CONTACT_PERSON_NAME]
# Check if Phone number is Integer
opening.phone_number = data[PHONE_NUMBER]
if data[PHONE_NUMBER].isdigit():
opening.phone_number = int(data[PHONE_NUMBER])
else:
raise ValueError('Phone number should be integer')
opening.email = data[EMAIL]

View File

@ -10,7 +10,6 @@ BRANCH_CHOICES = [
['EP', 'EP'],
['CIVIL', 'CIVIL'],
['CHEMICAL', 'CHEMICAL'],
['MNC','MNC']
]
ELIGIBLE_CHOICES = [
["Btech", "Btech"],
@ -42,7 +41,6 @@ BATCHES = [ #change it accordingly
"2020",
]
BATCH_CHOICES = [
["2023","2023"],
["2022", "2022"],
["2021", "2021"],
["2020", "2020"],
@ -67,7 +65,7 @@ TIERS = [
['7', 'Tier 7'],
['8', 'Open Tier'],
]
bTech = 'Btech'
# not being used anywhere
DEGREE_CHOICES = [
['bTech', 'B.Tech'],
@ -86,10 +84,7 @@ CDC_REPS_EMAILS = [
"satyapriya.gupta@iitdh.ac.in",
"dhriti.ghosh@iitdh.ac.in",
"suvamay.jana@iitdh.ac.in",
"ramesh.nayaka@iitdh.ac.in",
"210010003@iitdh.ac.in",
"210010046@iitdh.ac.in",
"210030035@iitdh.ac.in",
"ramesh.nayaka@iitdh.ac.in"
]
CDC_REPS_EMAILS_FOR_ISSUE=[ #add reps emails
"cdc.support@iitdh.ac.in",

View File

@ -92,7 +92,7 @@ class Placement(models.Model):
default=list, blank=True)
is_company_details_pdf = models.BooleanField(blank=False, default=False)
contact_person_name = models.CharField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT)
phone_number = models.CharField(max_length=15, blank=False)
phone_number = models.PositiveBigIntegerField(blank=False)
email = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
city = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
state = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
@ -383,7 +383,7 @@ class Internship(models.Model):
is_selection_procedure_details_pdf = models.BooleanField(blank=False, default=False)
#contact details of company person
contact_person_name = models.CharField(blank=False, max_length=JNF_TEXT_MAX_CHARACTER_COUNT)
phone_number = models.CharField(max_length=15, blank=False)
phone_number = models.PositiveBigIntegerField(blank=False)
email = models.EmailField(blank=False)
# contact_person_designation = models.CharField(blank=False, max_length=JNF_SMALLTEXT_MAX_CHARACTER_COUNT, default="")
# telephone_number = models.PositiveBigIntegerField(blank=True, default=None, null=True)

View File

@ -1,4 +1,3 @@
from datetime import datetime as dt
from rest_framework.decorators import api_view
from django.db.models import Q
@ -105,7 +104,7 @@ def getDashboard(request, id, email, user_type):
filters = Q(
allowed_branch__contains=[studentDetails.branch],
eligiblestudents__contains=[studentDetails.degree],
deadline_datetime__gte=dt.now(),
deadline_datetime__gte=datetime.now(),
offer_accepted=True,
email_verified=True
)

View File

@ -238,38 +238,38 @@ def PlacementApplicationConditions(student, placement):
PPO_PSU = [i for i in PPO if i.tier == 'psu']
# find length of PPO
if len(selected_companies) + len(PPO) >= MAX_OFFERS_PER_STUDENT:
raise PermissionError("Max Applications Reached for the Season1")
raise PermissionError("Max Applications Reached for the Season")
if len(selected_companies_PSU) > 0:
raise PermissionError('Selected for PSU Can\'t apply anymore2')
raise PermissionError('Selected for PSU Can\'t apply anymore')
if len(PPO_PSU) > 0:
raise PermissionError('Selected for PSU Can\'t apply anymore3')
raise PermissionError('Selected for PSU Can\'t apply anymore')
if placement.tier == 'psu':
return True, "Conditions Satisfied"
for i in selected_companies:
if 1.5 * i.placement.compensation_CTC > placement.compensation_CTC:
if 1.5 * i.compensation_CTC > placement.compensation_CTC:
return False, "Can't apply for this Placement, 1.5 times CTC condition not satisfied"
for i in PPO:
if 1.5 * i.compensation > placement.compensation_CTC:
if 1.5 * i.compensation_CTC > placement.compensation_CTC:
return False, "Can't apply for this Placement, 1.5 times CTC condition not satisfied"
if student.degree not in placement.eligiblestudents:
raise PermissionError("Can't apply for this placement4")
if student.degree == bTech and student.batch not in placement.allowed_batch:
raise PermissionError("Can't apply for this placement5")
raise PermissionError("Can't apply for this placement")
if student.degree == 'bTech' and student.batch not in placement.allowed_batch:
raise PermissionError("Can't apply for this placement")
if student.branch not in placement.allowed_branch:
raise PermissionError("Can't apply for this placement6")
raise PermissionError("Can't apply for this placement")
if student.can_apply == False:
raise PermissionError("Can't apply for this placement7")
raise PermissionError("Can't apply for this placement")
if student.isBacklog == True and placement.backlog_eligible == False:
raise PermissionError("Can't apply for this placement8")
raise PermissionError("Can't apply for this placement")
if student.isPwd == True and placement.pwd_eligible == False:
raise PermissionError("Can't apply for this placement9")
raise PermissionError("Can't apply for this placement")
if placement.cpi_eligible > student.cpi:
raise PermissionError("Can't apply for this placement10")
raise PermissionError("Can't apply for this placement")
return True, "Conditions Satisfied"