google-code-export / django-page-cms

Automatically exported from code.google.com/p/django-page-cms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Ugly "Permission denied" when unauthenticated user open /admin/pages/page #155

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Open URL /panel/pages/page/ without being authenticated

I expect the login page. I got a "<h1>Permission denied</h1>"

Original issue reported on code.google.com by marcob...@gmail.com on 23 Aug 2009 at 10:28

GoogleCodeExporter commented 9 years ago
Every other URL works as expected (/panel/pages/, /panel/pages/page/<id>), only
/panel/pages/page/ has this problem.

Adding in admin/__init__.py after:
    def list_pages(self, request, template_name=None, extra_context=None):
        """List root pages"""

These two lines:
        if not admin.site.has_permission(request):
            return admin.site.login(request)

Fixed the problem.

Original comment by marcob...@gmail.com on 23 Aug 2009 at 1:29

GoogleCodeExporter commented 9 years ago
I'm in a hurry and I don't know if this is the best patch. But works.

Original comment by marcob...@gmail.com on 23 Aug 2009 at 1:31

Attachments:

GoogleCodeExporter commented 9 years ago
Patch applied, thanks.

Original comment by batiste....@gmail.com on 24 Aug 2009 at 8:21