Skip to content

Commit

Permalink
CHANGED: auth extension
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Bredehöft committed Jul 13, 2015
1 parent b7a7274 commit 597d328
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion drf_tools/auth/permissionservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 597d328

Please sign in to comment.