Directory index rendering fails for non-admins. #33

Closed
opened 2023-05-02 00:58:39 +02:00 by anselm · 4 comments
anselm commented 2023-05-02 00:58:39 +02:00 (Migrated from gitlab.anselms.net)

Sentry Issue: ACE4-26

AttributeError: 'map' object has no attribute 'filter'
  File "ace4/cms/views.py", line 201, in dispatch
    return render_fileobject(request, path, obj, recurse, size_spec)
  File "ace4/cms/views.py", line 558, in render_fileobject
    content = dir_styles[style](request, path, obj)
  File "ace4/cms/views.py", line 366, in render_directory_index
    entries = entries.filter(status=S_PUBLISHED)

The problem here is that the .filter(status=S_PUBLISHED) is applied to something that isn't a queryset anymore. We have to move the check a few lines up so we can still do it on a queryset.

Sentry Issue: [ACE4-26](https://sentry.strathspey.org/organizations/strathspey/issues/157/?referrer=gitlab_integration) ``` AttributeError: 'map' object has no attribute 'filter' File "ace4/cms/views.py", line 201, in dispatch return render_fileobject(request, path, obj, recurse, size_spec) File "ace4/cms/views.py", line 558, in render_fileobject content = dir_styles[style](request, path, obj) File "ace4/cms/views.py", line 366, in render_directory_index entries = entries.filter(status=S_PUBLISHED) ``` The problem here is that the `.filter(status=S_PUBLISHED)` is applied to something that isn't a queryset anymore. We have to move the check a few lines up so we can still do it on a queryset.
anselm commented 2023-05-02 01:02:14 +02:00 (Migrated from gitlab.anselms.net)

changed the description

changed the description
anselm commented 2023-05-02 01:02:31 +02:00 (Migrated from gitlab.anselms.net)

created branch 33-directory-index-rendering-fails-for-non-admins to address this issue

created branch [`33-directory-index-rendering-fails-for-non-admins`](/strathspey/ace4/-/compare/main...33-directory-index-rendering-fails-for-non-admins) to address this issue
anselm commented 2023-05-02 01:03:08 +02:00 (Migrated from gitlab.anselms.net)

mentioned in merge request !6

mentioned in merge request !6
anselm commented 2023-05-02 01:10:16 +02:00 (Migrated from gitlab.anselms.net)

mentioned in commit 5ea5346321

mentioned in commit 5ea5346321462faf8107404f1fab438432720a8d
anselm (Migrated from gitlab.anselms.net) closed this issue 2023-05-02 01:10:16 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Strathspey/ace4#33
No description provided.