Skip to content

Commit

Permalink
fix error message formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
diesieben07 committed Dec 15, 2024
1 parent 8e69f75 commit d0ce6b6
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions strawberry_django/fields/field.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,16 +301,11 @@ def qs_hook(qs: models.QuerySet):
) # the queryset is already prefetched, no issue with just using len()
if qs_len == 0:
raise qs.model.DoesNotExist(
"%s matching query does not exist."
% qs.model._meta.object_name
f"{qs.model._meta.object_name} matching query does not exist."
)
if qs_len != 1:
raise qs.model.MultipleObjectsReturned(
"get() returned more than one %s -- it returned %s!"
% (
qs.model._meta.object_name,
qs_len,
)
f"get() returned more than one {qs.model._meta.object_name} -- it returned {qs_len}!"
)
return qs[0]
return qs.get()
Expand Down

0 comments on commit d0ce6b6

Please sign in to comment.