fix - transaction search

This commit is contained in:
2025-11-11 14:31:59 +03:30
parent 02d04ed0e8
commit c495309cc6
2 changed files with 3 additions and 4 deletions

View File

@@ -140,8 +140,8 @@ class RancherViewSet(viewsets.ModelViewSet, DynamicSearchMixin):
rancher = self.queryset.filter(national_code=request.data['national_code'])
# if len(rancher) > 1:
# raise DuplicateRancherException()
if len(rancher) > 1:
raise DuplicateRancherException()
if rancher.exists():
serializer = self.serializer_class(rancher.first())