[PR #17990] [MERGED] Fixes #17972: Force evaluation of LOGIN_REQUIRED when requesting static media #15245

Closed
opened 2025-12-30 00:20:50 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/17990
Author: @jeremystretch
Created: 11/12/2024
Status: Merged
Merged: 11/12/2024
Merged by: @jeremystretch

Base: developHead: 17972-media-login-required


📝 Commits (1)

  • 72908a4 Fixes #17972: Force evaluation of LOGIN_REQUIRED when requesting static media

📊 Changes

3 files changed (+31 additions, -4 deletions)

View changed files

📝 netbox/netbox/tests/test_views.py (+19 -1)
📝 netbox/netbox/urls.py (+2 -3)
📝 netbox/netbox/views/misc.py (+10 -0)

📄 Description

Fixes: #17972

Creates a new view, MediaView, to wrap Django's serve() view and enforce LOGIN_REQUIRED (if enabled) for uploaded media (e.g. image attachments).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/17990 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 11/12/2024 **Status:** ✅ Merged **Merged:** 11/12/2024 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `17972-media-login-required` --- ### 📝 Commits (1) - [`72908a4`](https://github.com/netbox-community/netbox/commit/72908a439ee998fe06e5d211174f7e02f4e328c4) Fixes #17972: Force evaluation of LOGIN_REQUIRED when requesting static media ### 📊 Changes **3 files changed** (+31 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/tests/test_views.py` (+19 -1) 📝 `netbox/netbox/urls.py` (+2 -3) 📝 `netbox/netbox/views/misc.py` (+10 -0) </details> ### 📄 Description ### Fixes: #17972 Creates a new view, MediaView, to wrap Django's `serve()` view and enforce `LOGIN_REQUIRED` (if enabled) for uploaded media (e.g. image attachments). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:20:50 +01:00
adam closed this issue 2025-12-30 00:20:50 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15245