mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix sonar
This commit is contained in:
parent
5a6229d282
commit
07e094d11e
@ -212,7 +212,7 @@ class ApiFilesUploadHandler(BaseApiHandler):
|
||||
},
|
||||
)
|
||||
logger.info(
|
||||
f"File upload completed. Filename: {self.filename}" f" Type: {u_type}"
|
||||
f"File upload completed. Filename: {self.filename} Type: {u_type}"
|
||||
)
|
||||
return self.finish_json(
|
||||
200,
|
||||
@ -242,7 +242,7 @@ class ApiFilesUploadHandler(BaseApiHandler):
|
||||
|
||||
# At this point filename, chunk index and total chunks are required
|
||||
# in the request
|
||||
if not self.filename or self.chunk_index is None or total_chunks is None:
|
||||
if not self.filename or self.chunk_index is None:
|
||||
logger.error(
|
||||
f"File upload failed. Filename: {self.filename}"
|
||||
f"Type: {u_type} Error: CHUNK INDEX NOT FOUND"
|
||||
|
@ -1,4 +1,4 @@
|
||||
async function uploadFile(type, file = null, path = null, file_num = 0, _onProgress) {
|
||||
async function uploadFile(type, file = null, path = null, file_num = 0, _onProgress = null) {
|
||||
if (file == null) {
|
||||
try {
|
||||
file = $("#file")[0].files[0];
|
||||
@ -153,8 +153,8 @@ async function uploadFile(type, file = null, path = null, file_num = 0, _onProgr
|
||||
let full_path = path + '/' + name;
|
||||
let flag = false;
|
||||
|
||||
for (let k = 0; k < items.length; ++k) {
|
||||
if ($(items[k]).attr("data-name") == name) {
|
||||
for (let item of items) {
|
||||
if ($(item).attr("data-name") === name) {
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user