Fix update fact

dev
timofejmalinin 2 years ago
parent 1130cfb253
commit b2dfbb66f7

@ -287,9 +287,10 @@ class PlacementPointViewSet(ReadOnlyModelViewSet):
@action(detail=False, methods=['put'])
def update_fact(self, request):
point_id = request.GET.get('postamat_id')
fact = request.GET.get('fact')
if not point_id or not fact or not fact.isdigit():
fact_ = request.GET.get('fact')
if not point_id or not fact_ or not fact_.isdigit():
return Response(status=HTTPStatus.BAD_REQUEST)
fact = float(fact_) if fact_ else None
qs = models.PlacementPoint.objects.filter(postamat_id=point_id)
if not qs:
return Response(status=HTTPStatus.NOT_FOUND)

Loading…
Cancel
Save