Refactor path -> filename
This commit is contained in:
parent
13b2995c34
commit
b266da63b2
1 changed files with 2 additions and 2 deletions
|
@ -77,13 +77,13 @@ class ReindexPageView(TemplateView):
|
|||
return HttpResponsePermanentRedirect(reverse('admin:index'))
|
||||
|
||||
|
||||
def send_from_file(request, path):
|
||||
def send_from_file(request, filename):
|
||||
request_for = ''
|
||||
if request.path.startswith('/geodata'):
|
||||
request_for = 'geodata'
|
||||
elif request.path.startswith('/data'):
|
||||
request_for = 'data'
|
||||
file_path = ospath.join(DATA_PATH, request_for, path)
|
||||
file_path = ospath.join(DATA_PATH, request_for, filename)
|
||||
file_to_send = open(file_path, 'rb')
|
||||
response = FileResponse(file_to_send)
|
||||
return response
|
||||
|
|
Loading…
Reference in a new issue