• Andrei Vagin's avatar
    permissions: add a fast path for non-authenticated users · 142e8fab
    Andrei Vagin authored
    patchwork returns a following back-trace without this patch:
    
    Internal Server Error: /patch/858/
    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
        response = wrapped_callback(request, *callback_args, **callback_kwargs)
      File "/srv/patchwork/lib/apache2/../../patchwork/views/patch.py", line 34, in patch
        editable = Can(request.user).edit(patch)
      File "/srv/patchwork/lib/apache2/../../patchwork/permissions.py", line 38, in edit
        can.edit(patch.project)))
      File "/srv/patchwork/lib/apache2/../../patchwork/permissions.py", line 32, in edit
        project in self.user.profile.maintainer_projects.all())
      File "/usr/lib/python2.7/site-packages/django/utils/functional.py", line 226, in inner
        return func(self._wrapped, *args)
    AttributeError: 'AnonymousUser' object has no attribute 'profile'
    
    Fixes: e876b068 ("permissions: Introduce central point for defining permissions")
    142e8fab
Name
Last commit
Last update
docs Loading commit data...
git-pw Loading commit data...
htdocs Loading commit data...
lib Loading commit data...
patchwork Loading commit data...
templates Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitignore Loading commit data...
.gitlab-ci.yml Loading commit data...
COPYING Loading commit data...
README.md Loading commit data...
manage.py Loading commit data...
tox.ini Loading commit data...