Skip to content

Commit

Permalink
added limit for import
Browse files Browse the repository at this point in the history
  • Loading branch information
UdaySagar-Git committed Mar 29, 2024
1 parent 1959e28 commit e3a6923
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions care/facility/api/viewsets/asset.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,8 @@ def bulk_upsert(self, request, *args, **kwargs):
if "location" not in request.data:
raise ValidationError({"location": "Location is required"})

limit = request.data.get("limit", None)
if limit is None:
limit = float("inf")
limit = 200

if len(request.data["assets"]) > limit:
raise ValidationError(
{"assets": f"Maximum of {limit} assets can be created at once"}
Expand Down

0 comments on commit e3a6923

Please sign in to comment.