Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[per-object-permissions] Fixes #2664 and #2663

  • Loading branch information...
commit 5c13ad5ea2d65cd705c6362ef4194b45725177f8 1 parent aef0582
Christopher Long authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 django/contrib/admin/views/row_level_permissions.py
View
8 django/contrib/admin/views/row_level_permissions.py
@@ -5,7 +5,7 @@
from django.contrib.contenttypes.models import ContentType
from django.contrib.auth.models import RowLevelPermission, User, Group
from django.db import models
-from django.contrib.admin.row_level_perm_manipulator import AddRLPManipulator, ChangeRLPManipulator
+from django.contrib.admin.row_level_perm_manipulator import AddRLPManipulator, ChangeRLPManipulator, MultipleObjSelectField
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist, PermissionDenied
from django.core.paginator import ObjectPaginator, InvalidPage
from django.contrib.admin.views.main import unquote, quote
@@ -78,12 +78,12 @@ def view_row_level_permissions(request, app_label, model_name, object_id):
group_ct = model_ct = ContentType.objects.get_for_model(Group)
user_ct = model_ct = ContentType.objects.get_for_model(User)
for r in rlp_list:
- owner_val = str(r.owner_ct)+"-"+str(r.owner_id)
+ owner_val = MultipleObjSelectField.returnKey(r.owner, r.owner_ct)
data = {'id':r.id, 'owner':owner_val, 'perm':r.permission.id, 'negative':r.negative}
- if r.owner_ct.id is user_ct.id:
+ if r.owner_ct.id == user_ct.id:
user_rlp_form_list.append({'form':forms.FormWrapper(edit_rlp_manip, data, rlp_errors), 'rlp':r})
- elif r.owner_ct.id is group_ct.id:
+ elif r.owner_ct.id == group_ct.id:
group_rlp_form_list.append({'form':forms.FormWrapper(edit_rlp_manip, data, rlp_errors), 'rlp':r})
else:
other_rlp_form_list.append({'form':forms.FormWrapper(edit_rlp_manip, data, rlp_errors), 'rlp':r})
Please sign in to comment.
Something went wrong with that request. Please try again.