X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/f16104e5ce08700745c66caf77c2e6403243059c..87bd94a94dc6cc3dbf47db2bdd17761b3f400138:/src/fileupload/views.py diff --git a/src/fileupload/views.py b/src/fileupload/views.py index eb7959c3..23fbc3bb 100644 --- a/src/fileupload/views.py +++ b/src/fileupload/views.py @@ -1,3 +1,6 @@ +# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# import json import os from urllib.parse import quote @@ -95,7 +98,7 @@ class UploadView(FormView): return super(UploadView, self).dispatch(request, *args, **kwargs) def get(self, request, *args, **kwargs): - if request.is_ajax(): + if request.headers.get('x-requested-with') == 'XMLHttpRequest': files = [] path = self.get_safe_path() if os.path.isdir(path):