Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[per-object-permissions] Fixes #2652, modified the form field to incl…

…ude the app label in the select field (the elements of which are now separated by a /)

git-svn-id: http://code.djangoproject.com/svn/django/branches/per-object-permissions@3716 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit aef05822d03fe0fb32be44d6bae27ee1e329d52a 1 parent ea2a514
Christopher Long authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 django/contrib/admin/row_level_perm_manipulator.py
View
8 django/contrib/admin/row_level_perm_manipulator.py
@@ -143,15 +143,15 @@ def render(self, data):
return '\n'.join(output)
def returnObject(data):
- data = data.split('-')
- ct = ContentType.objects.get(model__exact=data[0])
- obj = ct.get_object_for_this_type(pk=data[1])
+ data = data.split('/')
+ ct = ContentType.objects.get(app_label__exact=data[0], model__exact=data[1])
+ obj = ct.get_object_for_this_type(pk=data[2])
return obj
def returnKey(obj, ct=None):
if not ct:
ct = ContentType.objects.get_for_model(obj.__class__)
- return ct.model+"-"+str(obj.id)
+ return ct.app_label+"/"+ct.model+"/"+str(obj.id)
returnObject = staticmethod(returnObject)
returnKey = staticmethod(returnKey)
Please sign in to comment.
Something went wrong with that request. Please try again.