fix: estimate points update (#1003)

* fix: estimate points hub

* fix: estimate points update

* fix: estimate points bulk_update
This commit is contained in:
pablohashescobar 2023-05-05 15:12:38 +05:30 committed by GitHub
parent 336220bd98
commit 1bf1b63fff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View File

@ -57,7 +57,7 @@ class BulkEstimatePointEndpoint(BaseViewSet):
serializer = EstimateReadSerializer(estimates, many=True) serializer = EstimateReadSerializer(estimates, many=True)
return Response(serializer.data, status=status.HTTP_200_OK) return Response(serializer.data, status=status.HTTP_200_OK)
except Exception as e: except Exception as e:
print(e) capture_exception(e)
return Response( return Response(
{"error": "Something went wrong please try again later"}, {"error": "Something went wrong please try again later"},
status=status.HTTP_400_BAD_REQUEST, status=status.HTTP_400_BAD_REQUEST,
@ -211,7 +211,7 @@ class BulkEstimatePointEndpoint(BaseViewSet):
try: try:
EstimatePoint.objects.bulk_update( EstimatePoint.objects.bulk_update(
updated_estimate_points, ["value"], batch_size=10 updated_estimate_points, ["value"], batch_size=10,
) )
except IntegrityError as e: except IntegrityError as e:
return Response( return Response(

View File

@ -39,7 +39,6 @@ class EstimatePoint(ProjectBaseModel):
return f"{self.estimate.name} <{self.key}> <{self.value}>" return f"{self.estimate.name} <{self.key}> <{self.value}>"
class Meta: class Meta:
unique_together = ["value", "estimate"]
verbose_name = "Estimate Point" verbose_name = "Estimate Point"
verbose_name_plural = "Estimate Points" verbose_name_plural = "Estimate Points"
db_table = "estimate_points" db_table = "estimate_points"