Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Submission file name too long #1631

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/static/riot/competitions/detail/submission_upload.tag
Original file line number Diff line number Diff line change
Expand Up @@ -476,19 +476,29 @@
.fail(function (response) {
if (response) {
try {
let errors = JSON.parse(response.responseText);
let errors = JSON.parse(response.responseText)

// Clean up errors to not be arrays but plain text
Object.keys(errors).map(function (key, index) {
errors[key] = errors[key].join('; ')
})

// Create a string to concatenate all error messages
let errorMessages = "Error in submission upload:\n"
Object.keys(errors).forEach(function (key) {
errorMessages += key + ": " + errors[key] + "\n"
})

toastr.error(errorMessages)
self.update({errors: errors})
} catch (e) {

} catch (e) {
toastr.error("Error in submission upload\n"+e)
}
} else {
toastr.error("Something went wrong, please try again later")
}
toastr.error(`Creation failed, error occurred: ${response.responseJSON.data_file[0]}`)

})
.always(function () {
setTimeout(self.hide_progress_bar, 500)
Expand Down