fixed warnings

This commit is contained in:
uttamthummala 2023-10-20 20:37:31 +05:30
parent e428602ed5
commit 5901f0ea37
1 changed files with 2 additions and 5 deletions

View File

@ -125,10 +125,7 @@ def updateDeadline(request, id, email, user_type):
opening.deadline_datetime = datetime.datetime.strptime(data[DEADLINE_DATETIME], '%Y-%m-%d %H:%M:%S %z') opening.deadline_datetime = datetime.datetime.strptime(data[DEADLINE_DATETIME], '%Y-%m-%d %H:%M:%S %z')
opening.changed_by = get_object_or_404(User, id=id) opening.changed_by = get_object_or_404(User, id=id)
opening.save() opening.save()
deadline=opening.deadline_datetime deadline=opening.deadline_datetime.strftime('%Y-%m-%d %H:%M:%S %z')
itz=pytz.timezone('Asia/Kolkata')
deadline=deadline.astimezone(itz)
deadline=deadline.strftime('%Y-%m-%d %H:%M:%S')
send_opening_to_notifications_service(id=opening.id,name=opening.company_name,deadline=deadline,role=opening.designation) send_opening_to_notifications_service(id=opening.id,name=opening.company_name,deadline=deadline,role=opening.designation)
return Response({'action': "Update Deadline", 'message': "Deadline Updated"}, return Response({'action': "Update Deadline", 'message': "Deadline Updated"},
status=status.HTTP_200_OK) status=status.HTTP_200_OK)
@ -166,7 +163,7 @@ def updateOfferAccepted(request, id, email, user_type):
opening.changed_by = get_object_or_404(User, id=id) opening.changed_by = get_object_or_404(User, id=id)
opening.save() opening.save()
if opening.offer_accepted: if opening.offer_accepted:
deadline=deadline_datetime.strftime('%Y-%m-%d %H:%M:%S') deadline=deadline_datetime.strftime('%Y-%m-%d %H:%M:%S %z')
send_opening_to_notifications_service(id=opening.id,name=opening.company_name,deadline=deadline,role=opening.designation) send_opening_to_notifications_service(id=opening.id,name=opening.company_name,deadline=deadline,role=opening.designation)
send_opening_notifications(opening.id,opening_type) send_opening_notifications(opening.id,opening_type)
else: else: