divio/django-cms — pull request #1558 by adaptivelogic (2012-12-12 17:42:12+00:00)
Title: Simplify loading of view restrictions in the menu.

This refactoring aims to reduce the complexity of the query run when loading view restrictions in the menu code, solving #1224. When running with CMS_PERMISSION = False, the loading should be omitted entirely, saving considerable time.
The other aim is to move most of the view-restriction related code to cms.utils.permissions, allowing for sharing of cache and ensuring that both has_view_restriction and get_visible_sites are changed in parallel. Further, parts of the code was rewritten to enhance readability.