Removed <strong> in error response to prevent raw html insertion

This commit is contained in:
HugoNeveux 2020-04-27 18:52:29 +02:00
parent 564a7e8254
commit fe5da22985
2 changed files with 2 additions and 3 deletions

View File

@ -66,7 +66,6 @@ $('#multiFileUpload').dropzone({
let res = eval('(' + data.xhr.responseText + ')');
});
this.on("error", function(file, message) {
console.log(message);
$('.alert').html('');
$('#errorZone').append(message.error);
$('#errorZone').show();

View File

@ -61,8 +61,8 @@ class UploadView(LoginRequiredMixin, FormView):
module_info = toml.loads(f.read())
for required_field in REQUIRED_FIELDS:
if not required_field in module_info.keys():
return JsonResponse({'error': f'Field <strong>{required_field}\
</strong> is missing.'}, status=500)
return JsonResponse({'error': f'Field {required_field}\
is missing.'}, status=500)
shutil.rmtree(extract_path)
os.remove(zip_path)
if Module.objects.filter(name=module_info['name'].lower(),