P-13 Раздел окончен
This commit is contained in:
1 parent
b845f547a8
commit
5bc39212c8
6 files changed
+204
-62
No files matched your search
@@ -5,6 +5,8 @@ from datetime import date
|
||||
from .models import *
|
||||
from .serializers import *
|
||||
from rest_framework.response import Response
|
||||
import json
|
||||
import requests
|
||||
|
||||
|
||||
class GetStateSize(ListAPIView):
|
||||
@@ -14,7 +16,7 @@ class GetStateSize(ListAPIView):
|
||||
state_size = StateSizeSerializer(StateSize.objects.latest('date_created')).data
|
||||
except Exception as e:
|
||||
pass
|
||||
print(state_size, 'state_sizestate_sizestate_sizestate_sizestate_sizestate_sizestate_sizestate_sizestate_sizestate_sizestate_sizestate_sizestate_sizestate_sizestate_size')
|
||||
|
||||
return Response(state_size)
|
||||
|
||||
|
||||
@@ -29,6 +31,7 @@ class GetFactSize(ListAPIView):
|
||||
|
||||
|
||||
class GetInspectionDirections(ListAPIView):
|
||||
|
||||
queryset = InspectionDirections.objects.filter(department__isnull=True)
|
||||
serializer_class = InspectionDirectionsSerializer
|
||||
# отключает вывод информации о пагинации(count,previous,next, results)
|
||||
@@ -47,11 +50,15 @@ class GetVacancies(ListAPIView):
|
||||
|
||||
class PostResponseVacancies(ListAPIView):
|
||||
def post(self, request):
|
||||
ResponseVacancy.objects.update_or_create(vacancy_id=request.data['id'],
|
||||
defaults={'fio':request.data['resp']['name'],
|
||||
'text':request.data['resp']['message'],
|
||||
'email':request.data['resp']['email'],
|
||||
'tel':request.data['resp']['phone'],
|
||||
})
|
||||
print('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
|
||||
a = ResponseVacancy.objects.create(**json.loads(request.data['data']), file = request.data['file'] if 'file' in request.data else None)
|
||||
|
||||
return Response('ki')
|
||||
data = {'sendto':[a.vacancy.department.id_chief.lotus], 'subject': f'Отклик на вакансию {a.vacancy.name} от {a.fio}', 'body_text':f'Почта:{a.email} ----- Телефон: {a.tel} ---- Сопроводительное письмо: {a.text}'}
|
||||
|
||||
try:
|
||||
requests.post('http://10.252.44.13:8005/', data = data, files = [request.data['file']] if 'file' in request.data else [], timeout=2)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
|
||||
return Response('Ваше резюме отправленно')
|
||||
Reference in new issue
Block a user