diff --git a/CDC_Backend/APIs/companyViews.py b/CDC_Backend/APIs/companyViews.py index 3a44d3f..6774a13 100644 --- a/CDC_Backend/APIs/companyViews.py +++ b/CDC_Backend/APIs/companyViews.py @@ -14,7 +14,7 @@ logger = logging.getLogger('db') IS_COMPENSATION_DETAILS_PDF, ALLOWED_BRANCH, ELIGIBLESTUDENTS, SELECTION_PROCEDURE_ROUNDS, SELECTION_PROCEDURE_DETAILS, IS_SELECTION_PROCEDURE_DETAILS_PDF, TENTATIVE_DATE_OF_JOINING, TENTATIVE_NO_OF_OFFERS, OTHER_REQUIREMENTS, - RECAPTCHA_VALUE, JOB_LOCATION,PSYCHOMETRIC_TEST,MEDICAL_TEST,COMPANY_TURNOVER,NUMBER_OF_EMPLOYEES,BACKLOG_ELIGIBLE,PWD_ELIGIBLE,CPI ,COMPANY_TURNOVER,ESTABLISHMENT_DATE ,EXPECTED_NO_OF_OFFERS]) + RECAPTCHA_VALUE, JOB_LOCATION,PSYCHOMETRIC_TEST,MEDICAL_TEST,NUMBER_OF_EMPLOYEES,BACKLOG_ELIGIBLE,PWD_ELIGIBLE,CPI,EXPECTED_NO_OF_OFFERS]) def addPlacement(request): logger.info("JNF filled by " + str(request.data['email'])) @@ -139,12 +139,17 @@ def addPlacement(request): else: raise ValueError('Compensation CTC must be an integer') # Newly added + if data[COMPANY_TURNOVER].isdigit(): opening.company_turnover = int(data[COMPANY_TURNOVER]) - elif data[COMPANY_TURNOVER] is None: + elif data[COMPANY_TURNOVER] is None or data[COMPANY_TURNOVER] == '': opening.company_turnover = None else: - raise ValueError('Company Turnover must be an integer') + # Handle the case where the data is not a valid number or None/empty + # You can raise an error, set a default value, or log a warning + opening.company_turnover = None # Or some default value or error handling + + # Check if compensation_gross is integer if data[COMPENSATION_GROSS].isdigit(): @@ -227,8 +232,14 @@ def addPlacement(request): # Convert to date object opening.tentative_date_of_joining = datetime.datetime.strptime(data[TENTATIVE_DATE_OF_JOINING], '%d-%m-%Y').date() - opening.establishment_date = datetime.datetime.strptime(data[ESTABLISHMENT_DATE], - '%d-%m-%Y').date() # newly added field + establishment_date_str = data.get('ESTABLISHMENT_DATE', '') + if establishment_date_str: + try: + opening.establishment_date = datetime.datetime.strptime(establishment_date_str, '%d-%m-%Y').date() + except ValueError: + opening.establishment_date = None + else: + opening.establishment_date = None # Only Allowing Fourth Year for Placement opening.allowed_batch = [FOURTH_YEAR,] @@ -455,12 +466,18 @@ def addInternship(request): raise ValueError('Season must be a subset of ' + str(SEASONS)) internship.interning_period_from = datetime.datetime.strptime(data[START_DATE], '%d-%m-%Y').date() internship.interning_period_to = datetime.datetime.strptime(data[END_DATE], '%d-%m-%Y').date() - internship.establishment_date = datetime.datetime.strptime(data[ESTABLISHMENT_DATE], '%d-%m-%Y').date() # newly added field + establishment_date_str = data.get('ESTABLISHMENT_DATE', '') + if establishment_date_str: + try: + internship.establishment_date = datetime.datetime.strptime(establishment_date_str, '%d-%m-%Y').date() + except ValueError: + internship.establishment_date = None + else: + internship.establishment_date = None if data[WORK_TYPE] == 'Work from home': internship.is_work_from_home = True else: - internship.is_work_from_home = False - + internship.is_work_from_home = False if ALLOWED_BATCH in data and (data[ALLOWED_BATCH] is None or json.loads(data[ALLOWED_BATCH]) == ""): raise ValueError('Allowed Batches cannot be empty') elif ALLOWED_BATCH in data and set(json.loads(data[ALLOWED_BATCH])).issubset(BATCHES): @@ -529,10 +546,12 @@ def addInternship(request): # Newly added if data[COMPANY_TURNOVER].isdigit(): internship.company_turnover = int(data[COMPANY_TURNOVER]) - elif data[COMPANY_TURNOVER] is None: + elif data[COMPANY_TURNOVER] is None or data[COMPANY_TURNOVER] == '': internship.company_turnover = None else: - raise ValueError('Company Turnover must be an integer') + # Handle the case where the data is not a valid number or None/empty + # You can raise an error, set a default value, or log a warning + internship.company_turnover = None # Or some default value or error handling # newly added if data[EXPECTED_NO_OF_OFFERS].isdigit(): internship.expected_no_of_offers = int(data[EXPECTED_NO_OF_OFFERS]) diff --git a/CDC_Backend/APIs/constants.py b/CDC_Backend/APIs/constants.py index bc4fa72..ed2bfaf 100644 --- a/CDC_Backend/APIs/constants.py +++ b/CDC_Backend/APIs/constants.py @@ -10,13 +10,13 @@ BRANCH_CHOICES = [ ['EP', 'EP'], ['CIVIL', 'CIVIL'], ['CHEMICAL', 'CHEMICAL'], - ['BSMS', 'BSMS'], ] ELIGIBLE_CHOICES = [ ["Btech", "Btech"], ["MS", "MS"], ["MTech", "MTech"], ["PHD", "PHD"], + ["BSMS", "BSMS"], ] BRANCHES = [ "CSE", @@ -25,13 +25,14 @@ BRANCHES = [ "EP", "CIVIL", "CHEMICAL", - "BSMS", + "MNC", ] ELIGIBLE =[ "Btech", "MS", "MTech", "PHD", + "BSMS", ] BATCHES = [ #change it accordingly "2023", diff --git a/CDC_Backend/APIs/models.py b/CDC_Backend/APIs/models.py index 74c4627..427b25b 100644 --- a/CDC_Backend/APIs/models.py +++ b/CDC_Backend/APIs/models.py @@ -109,7 +109,7 @@ class Placement(models.Model): blank=True) is_description_pdf = models.BooleanField(blank=False, default=False) compensation_CTC = models.IntegerField(blank=False, default=None, null=True) # Job - Per Year - company_turnover = models.IntegerField(blank=False, default=None, null=True) # newly added field + company_turnover = models.IntegerField(blank=True, default=None, null=True) # newly added field compensation_gross = models.IntegerField(blank=False, default=None, null=True) compensation_take_home = models.IntegerField(blank=False, default=None, null=True) compensation_bonus = models.IntegerField(blank=True, default=None, null=True) @@ -142,7 +142,7 @@ class Placement(models.Model): ) tentative_no_of_offers = models.IntegerField(blank=False, default=None, null=True) expected_no_of_offers = models.IntegerField(blank=False , default=None , null=True) # newly added - number_of_employees = models.IntegerField(blank=False, default=None, null=True) # newly added field + number_of_employees = models.IntegerField(blank=True, default=None, null=True) # newly added field eligiblestudents = ArrayField( models.CharField(choices=ELIGIBLE_CHOICES, blank=False, max_length=10), size=10, diff --git a/CDC_Backend/templates/company_email_verification.html b/CDC_Backend/templates/company_email_verification.html index 9c12f7e..8bd9b3a 100644 --- a/CDC_Backend/templates/company_email_verification.html +++ b/CDC_Backend/templates/company_email_verification.html @@ -1,137 +1,196 @@ -
- - - + + + +
-
-
-
-
-
-
-
-
-
-
-
-
- Verification Required-We have received your {{opening_type}} Notification for {{designation}}. - Please verify your email by clicking the button below: -- Verify Email - - |
-
+
+
+
+
+
+
+
+
+
+ Verification Required++ We have received your + {{opening_type}} Notification for + {{designation}}. Please verify your email by + clicking the button below: + ++ Verify Email + + |
+
-
-
-
-
-
-
-
-
-
-
- Thank You For Filling The Form-We have received your {{ opening_type }} notification for a {{ designation }} offer at {{ company_name }}.
- We will keep you informed with the updates. If you have any queries, please feel free to write to |
+
+
+
+
Greetings of the day. Hope you are fine and doing well ! @@ -130,13 +130,13 @@
Follow us on:
- + - + - +copy right © 2024 CDC, all rights reserved
diff --git a/CDC_Backend/templates/reps_issue_submitted.html b/CDC_Backend/templates/reps_issue_submitted.html index 403651c..ef39d9c 100644 --- a/CDC_Backend/templates/reps_issue_submitted.html +++ b/CDC_Backend/templates/reps_issue_submitted.html @@ -1,162 +1,206 @@ - - - - + + + +
+
|
+