X-Git-Url: http://mmka.chem.univ.gda.pl/gitweb/?a=blobdiff_plain;f=filex%2Fuploadhandler.py;h=7e57a369b4923324199e39274f17a1dac9ab8706;hb=eb9d69959469d2041b34dbd1a827b8882cc0505c;hp=600524f4c3135612ac74e64961bd4accbfc6bde4;hpb=dee5b1cbf07c44e308dbccea2e49bb484eb6f2f5;p=qcg-portal.git diff --git a/filex/uploadhandler.py b/filex/uploadhandler.py index 600524f..7e57a36 100644 --- a/filex/uploadhandler.py +++ b/filex/uploadhandler.py @@ -1,9 +1,7 @@ -from functools import wraps import os from django.core.files.uploadedfile import UploadedFile from django.core.files.uploadhandler import FileUploadHandler, StopUpload, StopFutureHandlers -from django.views.decorators.csrf import csrf_exempt, csrf_protect from filex.forms import HostPathForm from filex.ftp import FTPOperation @@ -45,13 +43,3 @@ class FtpUploadHandler(FileUploadHandler): return UploadedFile(name=self.file_name, size=file_size, charset=self.charset, content_type=self.content_type, content_type_extra=self.content_type_extra) - - -def with_ftp_upload_handler(view_func): - @wraps(view_func) - def wrapped_view(request, *args, **kwargs): - request.upload_handlers = [FtpUploadHandler(request)] - - return csrf_protect(view_func)(request, *args, **kwargs) - - return csrf_exempt(wrapped_view)