Removed <strong> in error response to prevent raw html insertion
This commit is contained in:
parent
564a7e8254
commit
fe5da22985
@ -66,7 +66,6 @@ $('#multiFileUpload').dropzone({
|
|||||||
let res = eval('(' + data.xhr.responseText + ')');
|
let res = eval('(' + data.xhr.responseText + ')');
|
||||||
});
|
});
|
||||||
this.on("error", function(file, message) {
|
this.on("error", function(file, message) {
|
||||||
console.log(message);
|
|
||||||
$('.alert').html('');
|
$('.alert').html('');
|
||||||
$('#errorZone').append(message.error);
|
$('#errorZone').append(message.error);
|
||||||
$('#errorZone').show();
|
$('#errorZone').show();
|
||||||
|
@ -61,8 +61,8 @@ class UploadView(LoginRequiredMixin, FormView):
|
|||||||
module_info = toml.loads(f.read())
|
module_info = toml.loads(f.read())
|
||||||
for required_field in REQUIRED_FIELDS:
|
for required_field in REQUIRED_FIELDS:
|
||||||
if not required_field in module_info.keys():
|
if not required_field in module_info.keys():
|
||||||
return JsonResponse({'error': f'Field <strong>{required_field}\
|
return JsonResponse({'error': f'Field {required_field}\
|
||||||
</strong> is missing.'}, status=500)
|
is missing.'}, status=500)
|
||||||
shutil.rmtree(extract_path)
|
shutil.rmtree(extract_path)
|
||||||
os.remove(zip_path)
|
os.remove(zip_path)
|
||||||
if Module.objects.filter(name=module_info['name'].lower(),
|
if Module.objects.filter(name=module_info['name'].lower(),
|
||||||
|
Loading…
Reference in New Issue
Block a user