backups: Remove dead code

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2019-01-30 11:13:41 -08:00 committed by James Valleroy
parent 34e0394713
commit c22bec1cf4
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -19,7 +19,6 @@ Views for the backups app.
"""
import logging
import mimetypes
import os
import tempfile
from datetime import datetime
@ -27,7 +26,7 @@ from urllib.parse import unquote
from django.contrib import messages
from django.contrib.messages.views import SuccessMessageMixin
from django.http import Http404, FileResponse, StreamingHttpResponse
from django.http import Http404, StreamingHttpResponse
from django.shortcuts import redirect
from django.urls import reverse_lazy
from django.utils.decorators import method_decorator
@ -122,15 +121,6 @@ class DeleteArchiveView(SuccessMessageMixin, TemplateView):
return redirect('backups:index')
def _get_file_response(path, filename):
"""Read and return a downloadable file"""
(content_type, _) = mimetypes.guess_type(filename)
response = FileResponse(open(path, 'rb'), content_type=content_type)
content_disposition = 'attachment; filename="%s"' % filename
response['Content-Disposition'] = content_disposition
return response
class UploadArchiveView(SuccessMessageMixin, FormView):
form_class = forms.UploadForm
prefix = 'backups'