diff --git a/drf_tools/auth/permissionservice.py b/drf_tools/auth/permissionservice.py index 86fc339..011797b 100644 --- a/drf_tools/auth/permissionservice.py +++ b/drf_tools/auth/permissionservice.py @@ -69,7 +69,9 @@ def _get_permission_model_ids_from_request_data(self, request, model, view): continue kwarg_key_without_prefix = kwarg_key.replace(drf_nested_routing.PARENT_LOOKUP_NAME_PREFIX, '') - if '__' in kwarg_key: + if kwarg_key.endswith('__' + permission_model_attr): + return [view.kwargs[kwarg_key]] + elif '__' in kwarg_key: other_parent = kwarg_key_without_prefix.split('__')[0] if LINKS_FIELD_NAME in request.data and other_parent in request.data[LINKS_FIELD_NAME]: other_parent_id = get_id_from_detail_uri(request.data[LINKS_FIELD_NAME][other_parent]) diff --git a/setup.py b/setup.py index 444b718..576d016 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='drf-tools', - version="0.9.12", + version="0.9.13", url='https://github.com/seebass/drf-tools', license='MIT', description='Multiple extensions and test utilities for Django REST Framework 3',