Skip to content

Commit

Permalink
Update views.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeshingles committed Sep 3, 2024
1 parent 1ad54d3 commit 5d083a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions atlasserver/forcephot/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def perform_create(self, serializer) -> None:
if self.request.user and self.request.user.is_authenticated:
usertaskcount = Task.objects.filter(user_id=self.request.user.pk, request_type="IMGZIP").count()
if usertaskcount >= maximgziptasks:
msg = f"You have too many IMGZIP tasks ({usertaskcount} > {maximgziptasks}). Issue delete requests to remove some."
msg = f"You have too many IMGZIP tasks ({usertaskcount} >= {maximgziptasks}). Issue delete requests to remove some."
raise ValidationError(msg)

extra_fields: dict[str, Any] = {
Expand Down Expand Up @@ -359,7 +359,7 @@ def get(self, request, pk):
if self.request.user and self.request.user.is_authenticated:
usertaskcount = Task.objects.filter(user_id=self.request.user.pk, request_type="IMGZIP").count()
if usertaskcount >= maximgziptasks:
msg = f"You have too many IMGZIP tasks ({usertaskcount} > {maximgziptasks}). Delete some before making new requests."
msg = f"You have too many IMGZIP tasks ({usertaskcount} >= {maximgziptasks}). Delete some before making new requests."
return JsonResponse({"error": msg}, status=429)

if not parent_task.error_msg and parent_task.finishtimestamp:
Expand Down

0 comments on commit 5d083a7

Please sign in to comment.