fix edit password - organization fix childs
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user