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'))
|
return HttpResponsePermanentRedirect(reverse('admin:index'))
|
||||||
|
|
||||||
|
|
||||||
def send_from_file(request, path):
|
def send_from_file(request, filename):
|
||||||
request_for = ''
|
request_for = ''
|
||||||
if request.path.startswith('/geodata'):
|
if request.path.startswith('/geodata'):
|
||||||
request_for = 'geodata'
|
request_for = 'geodata'
|
||||||
elif request.path.startswith('/data'):
|
elif request.path.startswith('/data'):
|
||||||
request_for = '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')
|
file_to_send = open(file_path, 'rb')
|
||||||
response = FileResponse(file_to_send)
|
response = FileResponse(file_to_send)
|
||||||
return response
|
return response
|
||||||
|
|
Loading…
Reference in a new issue