Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Custom kwargs in serve_private_file URL pattern #197

Closed
pandafy opened this issue Jun 8, 2022 · 0 comments · Fixed by #198
Closed

[bug] Custom kwargs in serve_private_file URL pattern #197

pandafy opened this issue Jun 8, 2022 · 0 comments · Fixed by #198
Labels
bug Something isn't working

Comments

@pandafy
Copy link
Member

pandafy commented Jun 8, 2022

We have used custom URL kwarg in the serve_private_file URL.

urlpatterns = [
path(
urljoin(IMAGE_URL_PATH, '<path:imagefile>'),
views.firmware_image_download,
name='serve_private_file',
),
]

class FirmwareImageDownloadView(PrivateStorageDetailView):
model = load_model('FirmwareImage')
model_file_field = 'file'
slug_field = 'file'
slug_url_kwarg = 'imagefile'

This breaks the functionality of PrivateS3BotoStorage which uses this URL with path keyword argument. We should change imagefile to path for consistency with private_storage module.

https://github.com/edoburu/django-private-storage/blob/cfe1e62e2458798760fe6f6c9825e2f663d25ac1/private_storage/storage/s3boto3.py#L58-L64

@pandafy pandafy added the bug Something isn't working label Jun 8, 2022
@pandafy pandafy changed the title [bug] Custom kwargs in serve_private_file [bug] Custom kwargs in serve_private_file URL pattern Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
1 participant