Skip to content

Commit

Permalink
just use __self__
Browse files Browse the repository at this point in the history
Co-authored-by: Wildcard Corp. <corporate@wildcardcorp.com>
  • Loading branch information
vangheem and Wildcard Corp. committed Nov 15, 2018
1 parent 7e56cfe commit ac6ec4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion news/43.bugfix
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Check for both `__self__` and `im_self` for Python 3 compatibility
Change `im_self` to `__self__`
[vangheem]
9 changes: 3 additions & 6 deletions src/Products/PlonePAS/plugins/local_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ def getRolesInContext(self, user, object):
object = parent
continue

new = (getattr(object, 'im_self', None) or
getattr(object, '__self__', None))
new = getattr(object, '__self__', None)

if new is not None:
object = aq_inner(new)
Expand Down Expand Up @@ -135,8 +134,7 @@ def checkLocalRolesAllowed(self, user, object, object_roles):
inner_obj = parent
continue

new = (getattr(inner_obj, 'im_self', None) or
getattr(inner_obj, '__self__', None))
new = getattr(inner_obj, '__self__', None)

if new is not None:
inner_obj = aq_inner(new)
Expand Down Expand Up @@ -177,8 +175,7 @@ def getAllLocalRolesInContext(self, context):
object = parent
continue

new = (getattr(object, 'im_self', None) or
getattr(object, '__self__', None))
new = getattr(object, '__self__', None)

if new is not None:
object = aq_inner(new)
Expand Down

0 comments on commit ac6ec4e

Please sign in to comment.