fusionbox / django-widgy

A CMS framework for Django built on a heterogenous tree editor.
http://wid.gy
Other
332 stars 52 forks source link

`SitePermission` issues with widgy_mezzanine #360

Closed julianandrews closed 8 years ago

julianandrews commented 8 years ago

Since https://github.com/stephenmcd/mezzanine/commit/d5d21ba527bd417de956cc1f768d98ca7f851c13 sitepermissions aren't guaranteed to exist. This creates a couple potential problems.

First, staff users on sites not using mezzanine.core.middleware.SitePermissionMiddleware without explicitly defined sitepermissions will cause RelatedObjectDoesNotExist bugs.

Second, the MultiSiteCalloutAdmin (https://github.com/fusionbox/django-widgy/blob/master/widgy/contrib/widgy_mezzanine/admin.py#L347) assumes all users have sitepermissions.

I've put in a pull request to mezzanine (https://github.com/stephenmcd/mezzanine/pull/1501) which if accepted will fix the first issue. The best fix for the second issue will depend on whether the pull request is merged in.