removing prints
This commit is contained in:
parent
756dd5ae61
commit
ce0f45d2bf
|
@ -114,7 +114,6 @@ def updateOfferAccepted(request, id, email, user_type):
|
||||||
opening.offer_accepted = True
|
opening.offer_accepted = True
|
||||||
opening.changed_by = get_object_or_404(User, id=id)
|
opening.changed_by = get_object_or_404(User, id=id)
|
||||||
opening.save()
|
opening.save()
|
||||||
print('offer accepted sending email to students')
|
|
||||||
send_opening_notifications(opening.id)
|
send_opening_notifications(opening.id)
|
||||||
return Response({'action': "Update Offer Accepted", 'message': "Offer Accepted Updated"},
|
return Response({'action': "Update Offer Accepted", 'message': "Offer Accepted Updated"},
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
|
@ -350,7 +349,6 @@ def generateCSV(request, id, email, user_type):
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
except:
|
except:
|
||||||
logger.warning("Create csv: " + str(sys.exc_info()))
|
logger.warning("Create csv: " + str(sys.exc_info()))
|
||||||
print(sys.exc_info())
|
|
||||||
return Response({'action': "Create csv", 'message': "Something Went Wrong"},
|
return Response({'action': "Create csv", 'message': "Something Went Wrong"},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
@ -381,7 +379,6 @@ def addPPO(request, id, email, user_type):
|
||||||
status=status.HTTP_200_OK)
|
status=status.HTTP_200_OK)
|
||||||
except:
|
except:
|
||||||
logger.warning("Add PPO: " + str(sys.exc_info()))
|
logger.warning("Add PPO: " + str(sys.exc_info()))
|
||||||
print(sys.exc_info())
|
|
||||||
return Response({'action': "Add PPO", 'message': "Something Went Wrong"},
|
return Response({'action': "Add PPO", 'message': "Something Went Wrong"},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
|
|
|
@ -278,9 +278,6 @@ def verifyEmail(request):
|
||||||
"opening_type": PLACEMENT,
|
"opening_type": PLACEMENT,
|
||||||
"company_name": opening.company_name,
|
"company_name": opening.company_name,
|
||||||
}
|
}
|
||||||
print(data)
|
|
||||||
print(attachment_jnf_respone)
|
|
||||||
json_data = json.dumps(data, default=str)
|
|
||||||
sendEmail(opening.email, COMPANY_OPENING_SUBMITTED_TEMPLATE_SUBJECT.format(id=opening.id), data,
|
sendEmail(opening.email, COMPANY_OPENING_SUBMITTED_TEMPLATE_SUBJECT.format(id=opening.id), data,
|
||||||
COMPANY_OPENING_SUBMITTED_TEMPLATE, attachment_jnf_respone)
|
COMPANY_OPENING_SUBMITTED_TEMPLATE, attachment_jnf_respone)
|
||||||
|
|
||||||
|
|
|
@ -71,9 +71,7 @@ def getDashboard(request, id, email, user_type):
|
||||||
allowed_branch__contains=[studentDetails.branch],
|
allowed_branch__contains=[studentDetails.branch],
|
||||||
deadline_datetime__gte=datetime.datetime.now(),
|
deadline_datetime__gte=datetime.datetime.now(),
|
||||||
offer_accepted=True, email_verified=True).order_by('deadline_datetime')
|
offer_accepted=True, email_verified=True).order_by('deadline_datetime')
|
||||||
print(placements)
|
|
||||||
filtered_placements = placement_eligibility_filters(studentDetails, placements)
|
filtered_placements = placement_eligibility_filters(studentDetails, placements)
|
||||||
print(filtered_placements)
|
|
||||||
|
|
||||||
placementsdata = PlacementSerializerForStudent(filtered_placements, many=True).data
|
placementsdata = PlacementSerializerForStudent(filtered_placements, many=True).data
|
||||||
|
|
||||||
|
@ -88,7 +86,6 @@ def getDashboard(request, id, email, user_type):
|
||||||
status=status.HTTP_404_NOT_FOUND)
|
status=status.HTTP_404_NOT_FOUND)
|
||||||
except:
|
except:
|
||||||
logger.warning("Get Dashboard -Student: " + str(sys.exc_info()))
|
logger.warning("Get Dashboard -Student: " + str(sys.exc_info()))
|
||||||
print(sys.exc_info())
|
|
||||||
|
|
||||||
return Response({'action': "Get Dashboard - Student", 'message': "Something Went Wrong"},
|
return Response({'action': "Get Dashboard - Student", 'message': "Something Went Wrong"},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
@ -198,8 +195,6 @@ def submitApplication(request, id, email, user_type):
|
||||||
status=status.HTTP_404_NOT_FOUND)
|
status=status.HTTP_404_NOT_FOUND)
|
||||||
except:
|
except:
|
||||||
logger.warning("Submit Application: " + str(sys.exc_info()))
|
logger.warning("Submit Application: " + str(sys.exc_info()))
|
||||||
print(traceback.format_exc())
|
|
||||||
|
|
||||||
print(sys.exc_info())
|
|
||||||
return Response({'action': "Submit Application", 'message': "Something Went Wrong"},
|
return Response({'action': "Submit Application", 'message': "Something Went Wrong"},
|
||||||
status=status.HTTP_400_BAD_REQUEST)
|
status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
|
@ -77,7 +77,6 @@ def isAuthorized(allowed_users=None):
|
||||||
token_id = headers['HTTP_AUTHORIZATION'][7:]
|
token_id = headers['HTTP_AUTHORIZATION'][7:]
|
||||||
idinfo = id_token.verify_oauth2_token(token_id, requests.Request(), CLIENT_ID)
|
idinfo = id_token.verify_oauth2_token(token_id, requests.Request(), CLIENT_ID)
|
||||||
email = idinfo[EMAIL]
|
email = idinfo[EMAIL]
|
||||||
print(email)
|
|
||||||
user = get_object_or_404(User, email=email)
|
user = get_object_or_404(User, email=email)
|
||||||
if user:
|
if user:
|
||||||
user.last_login_time = timezone.now()
|
user.last_login_time = timezone.now()
|
||||||
|
@ -160,7 +159,6 @@ def sendEmail(email_to, subject, data, template, attachment_jnf_response=None):
|
||||||
return True
|
return True
|
||||||
except:
|
except:
|
||||||
logger.error("Send Email: " + str(sys.exc_info()))
|
logger.error("Send Email: " + str(sys.exc_info()))
|
||||||
print(str(sys.exc_info()[1]))
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
@ -175,12 +173,10 @@ def PlacementApplicationConditions(student, placement):
|
||||||
|
|
||||||
if len(selected_companies_PSU) > 0:
|
if len(selected_companies_PSU) > 0:
|
||||||
raise PermissionError('Selected for PSU Can\'t apply anymore')
|
raise PermissionError('Selected for PSU Can\'t apply anymore')
|
||||||
print(placement, 'placement')
|
|
||||||
if placement.tier == 'psu':
|
if placement.tier == 'psu':
|
||||||
return True, "Conditions Satisfied"
|
return True, "Conditions Satisfied"
|
||||||
|
|
||||||
for i in selected_companies:
|
for i in selected_companies:
|
||||||
print(int(i.placement.tier) < int(placement.tier), int(i.placement.tier), int(placement.tier))
|
|
||||||
if int(i.placement.tier) < int(placement.tier):
|
if int(i.placement.tier) < int(placement.tier):
|
||||||
return False, "Can't apply for this tier"
|
return False, "Can't apply for this tier"
|
||||||
|
|
||||||
|
@ -189,9 +185,6 @@ def PlacementApplicationConditions(student, placement):
|
||||||
except PermissionError as e:
|
except PermissionError as e:
|
||||||
return False, e
|
return False, e
|
||||||
except:
|
except:
|
||||||
print(sys.exc_info())
|
|
||||||
print(traceback.format_exc())
|
|
||||||
|
|
||||||
logger.warning("Utils - PlacementApplicationConditions: " + str(sys.exc_info()))
|
logger.warning("Utils - PlacementApplicationConditions: " + str(sys.exc_info()))
|
||||||
return False, "_"
|
return False, "_"
|
||||||
|
|
||||||
|
@ -229,7 +222,6 @@ def getTier(compensation_gross, is_psu=False):
|
||||||
logger.warning("Utils - getTier: " + str(sys.exc_info()))
|
logger.warning("Utils - getTier: " + str(sys.exc_info()))
|
||||||
return False, e
|
return False, e
|
||||||
except:
|
except:
|
||||||
print(sys.exc_info())
|
|
||||||
logger.warning("Utils - getTier: " + str(sys.exc_info()))
|
logger.warning("Utils - getTier: " + str(sys.exc_info()))
|
||||||
return False, "_"
|
return False, "_"
|
||||||
|
|
||||||
|
@ -246,29 +238,21 @@ def generateOneTimeVerificationLink(email, opening_id, opening_type):
|
||||||
link = LINK_TO_EMAIl_VERIFICATION_API.format(token=token)
|
link = LINK_TO_EMAIl_VERIFICATION_API.format(token=token)
|
||||||
return True, link
|
return True, link
|
||||||
except:
|
except:
|
||||||
print(sys.exc_info())
|
|
||||||
logger.warning("Utils - generateOneTimeVerificationLink: " + str(sys.exc_info()))
|
logger.warning("Utils - generateOneTimeVerificationLink: " + str(sys.exc_info()))
|
||||||
return False, "_"
|
return False, "_"
|
||||||
|
|
||||||
|
|
||||||
def verify_recaptcha(request):
|
def verify_recaptcha(request):
|
||||||
try:
|
try:
|
||||||
print(settings.RECAPTCHA_SECRET_KEY)
|
|
||||||
data = {
|
data = {
|
||||||
'secret': settings.RECAPTCHA_SECRET_KEY,
|
'secret': settings.RECAPTCHA_SECRET_KEY,
|
||||||
'response': request
|
'response': request
|
||||||
}
|
}
|
||||||
print(data)
|
|
||||||
r = rq.post('https://www.google.com/recaptcha/api/siteverify', data=data)
|
r = rq.post('https://www.google.com/recaptcha/api/siteverify', data=data)
|
||||||
result = r.json()
|
result = r.json()
|
||||||
# logger.info("Recaptcha Response: " + str(result)+"request: "+str(data))
|
|
||||||
|
|
||||||
print(result, "Result")
|
|
||||||
return result['success']
|
return result['success']
|
||||||
except:
|
except:
|
||||||
# get exception line number
|
# get exception line number
|
||||||
print(sys.exc_info())
|
|
||||||
print(traceback.format_exc())
|
|
||||||
logger.warning("Utils - verify_recaptcha: " + str(sys.exc_info()))
|
logger.warning("Utils - verify_recaptcha: " + str(sys.exc_info()))
|
||||||
return False, "_"
|
return False, "_"
|
||||||
|
|
||||||
|
@ -293,7 +277,6 @@ def opening_description_table_html(opening):
|
||||||
new_key = new_key.capitalize()
|
new_key = new_key.capitalize()
|
||||||
newdetails[new_key] = details[key]
|
newdetails[new_key] = details[key]
|
||||||
imagepath = os.path.abspath('./templates/image.png')
|
imagepath = os.path.abspath('./templates/image.png')
|
||||||
print(imagepath)
|
|
||||||
data = {
|
data = {
|
||||||
"data": newdetails,
|
"data": newdetails,
|
||||||
"imgpath": imagepath
|
"imgpath": imagepath
|
||||||
|
|
Loading…
Reference in New Issue