fix edit password - organization fix childs

This commit is contained in:
2025-08-07 09:45:02 +03:30
parent 6477a35200
commit 482ae540fd
4 changed files with 8 additions and 4 deletions

View File

@@ -55,7 +55,10 @@ class QuotaViewSet(viewsets.ModelViewSet, DynamicSearchMixin): # noqa
user_relation = request.user.user_relation.all().first()
# add user relation to data
request.data['registerer_organization'] = user_relation.organization.id
if user_relation.organization:
request.data['registerer_organization'] = user_relation.organization.id
else:
raise APIException("برای این کاربر سازمانی تعریف نشده است") # noqa
# create quota
serializer = self.serializer_class(data=request.data)