fix token errors

This commit is contained in:
karthikmurakonda 2023-10-11 07:18:28 +05:30
parent 12ec9619a6
commit 41adfa3796
3 changed files with 7 additions and 6 deletions

View File

@ -425,7 +425,6 @@ def generateCSV(request, id, email, user_type):
applications = PlacementApplication.objects.filter(placement=opening) applications = PlacementApplication.objects.filter(placement=opening)
filename = generateRandomString() filename = generateRandomString()
if not os.path.isdir(STORAGE_DESTINATION_APPLICATION_CSV): if not os.path.isdir(STORAGE_DESTINATION_APPLICATION_CSV):
# create directory if not present already even if first directory is not present
os.makedirs(STORAGE_DESTINATION_APPLICATION_CSV, exist_ok=True) os.makedirs(STORAGE_DESTINATION_APPLICATION_CSV, exist_ok=True)
destination_path = STORAGE_DESTINATION_APPLICATION_CSV + filename + ".csv" destination_path = STORAGE_DESTINATION_APPLICATION_CSV + filename + ".csv"
f = open(destination_path, 'w') f = open(destination_path, 'w')
@ -459,7 +458,7 @@ 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()))
return Response({'action': "Create csv", 'message': "Something Went Wrong"+str(sys.exc_info())}, return Response({'action': "Create csv", 'message': "Something Went Wrong"},
status=status.HTTP_400_BAD_REQUEST) status=status.HTTP_400_BAD_REQUEST)

View File

@ -298,7 +298,7 @@ def verifyEmail(request):
status=status.HTTP_400_BAD_REQUEST) status=status.HTTP_400_BAD_REQUEST)
except: except:
logger.warning("Verify Email: " + str(sys.exc_info())) logger.warning("Verify Email: " + str(sys.exc_info()))
return Response({'action': "Verify Email", 'message': "Something went wrong\n"+str(sys.exc_info())}, return Response({'action': "Verify Email", 'message': "Something went wrong"},
status=status.HTTP_400_BAD_REQUEST) status=status.HTTP_400_BAD_REQUEST)

View File

@ -303,7 +303,7 @@ class StudentViewsTestCase(APITestCase):
def test_add_application_placement_deadlinePassed(self): def test_add_application_placement_deadlinePassed(self):
self.placement.deadline_datetime = timezone.now().replace( self.placement.deadline_datetime = timezone.now().replace(
hour=0, minute=0, second=0, microsecond=0) hour=0, minute=0, second=0, microsecond=0) - datetime.timedelta(minutes=5)
self.placement.save() self.placement.save()
# deleted existing application # deleted existing application
self.placement_application.delete() self.placement_application.delete()
@ -561,8 +561,10 @@ class StudentViewsTestCase(APITestCase):
student=self.student).count(), 1) student=self.student).count(), 1)
def test_add_application_internship_deadlinePassed(self): def test_add_application_internship_deadlinePassed(self):
self.internship.deadline_datetime = timezone.now().replace( # now minus 5 minutes
hour=0, minute=0, second=0, microsecond=0) self.internship.deadline_datetime = timezone.now().replace
(hour=0, minute=0, second=0, microsecond=0) - datetime.timedelta(minutes=5)
self.internship.save() self.internship.save()
# deleted existing application # deleted existing application
self.internship_application.delete() self.internship_application.delete()