openwisp / openwisp-radius

Administration web interface and REST API for freeradius 3 build in django & python. Supports captive portal authentication, WPA Enerprise (802.1x), freeradius rlm_rest, social login, Hotspot 2.0 / 802.11u, importing users from CSV, registration of new users and more.

Home Page:https://openwisp.io/docs/dev/radius/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] Custom kwargs in serve_private_file URL pattern

pandafy opened this issue · comments

Similar to openwisp/openwisp-firmware-upgrader#197

We have used custom URL kwarg in the serve_private_file URL.

def get_private_store_urls():
return [
path(
urljoin(app_settings.CSV_URL_PATH, '<path:csvfile>'),
views.rad_batch_csv_download_view,
name='serve_private_file',
)
]

class RadiusBatchCsvDownloadView(PrivateStorageDetailView):
storage = _get_csv_file_private_storage
model = load_model('RadiusBatch')
model_file_field = 'csvfile'
slug_field = 'csvfile'
slug_url_kwarg = 'csvfile'

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

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