From: Wichert A. <svn...@pl...> - 2008-07-02 07:08:10
|
Author: wichert Date: Wed Jul 2 07:08:19 2008 New Revision: 21344 Modified: plone.app.workflow/trunk/plone/app/workflow/browser/sharing.py Log: Reformat the code flow a bit to make it more readable. I had to look too long at r21342 to see if it was correct. Modified: plone.app.workflow/trunk/plone/app/workflow/browser/sharing.py ============================================================================== --- plone.app.workflow/trunk/plone/app/workflow/browser/sharing.py (original) +++ plone.app.workflow/trunk/plone/app/workflow/browser/sharing.py Wed Jul 2 07:08:19 2008 @@ -415,18 +415,13 @@ if not portal_membership.checkPermission(permissions.ModifyPortalContent, context): raise Unauthorized - reindex = False - if not status: - if not getattr(aq_base(context), '__ac_local_roles_block__', None): - reindex = True - context.__ac_local_roles_block__ = True - else: - if getattr(aq_base(context), '__ac_local_roles_block__', None): - reindex = True - context.__ac_local_roles_block__ = None + oldstatus = bool(getattr(aq_base(context), '__ac_local_roles_block__', False)) - if reindex: - context.reindexObjectSecurity() + if status == oldstatus: + return + + context.__ac_local_roles_block__ = status and True or None + context.reindexObjectSecurity() @clearafter def update_role_settings(self, new_settings): |