1
0
mirror of https://github.com/django/django.git synced 2025-07-04 17:59:13 +00:00

[per-object-permissions] Fixes the delete permission which assumed the object had an id attribute

git-svn-id: http://code.djangoproject.com/svn/django/branches/per-object-permissions@3764 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Christopher Long 2006-09-15 19:01:37 +00:00
parent 43260cfbf2
commit a2fbd5f14c

View File

@ -124,7 +124,8 @@ def delete_row_level_permission(request, app_label, model_name, object_id, ct_id
ct = rlp.model_ct
obj = rlp.model
if not (model_instance.id == rlp.model_id):
model_id = model_instance._get_pk_val()
if not (model_id == rlp.model_id):
raise PermissionDenied
if not request.user.has_perm(rlp._meta.app_label + '.' + rlp._meta.get_delete_permission()):