Commit 5d0a570c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

validation of project name added

parent 26e4bc2b
Pipeline #13861 passed with stage
in 11 minutes and 18 seconds
minerva (14.0.0~beta.2) unstable; urgency=low
* Bug fix: allow user to remove own comments (#931)
* Bug fix: validation of project name length is provided (#950)
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 16 Sep 2019 21:00:00 +0200
......
......@@ -1282,6 +1282,11 @@ AddProjectDialog.prototype.checkValidity = function () {
isValid = false;
}
var name = self.getName();
if (name.length > 255) {
error += "<li>name must be shorter than 256 characters</li>";
isValid = false;
}
var rootExist = 0, i;
for (i = 0; i < self.getZipEntries().length; i++) {
......
......@@ -276,6 +276,9 @@ public class ProjectRestImpl extends BaseRestImpl {
throw new QueryException("You cannot modify projectId");
}
} else if (fieldName.equalsIgnoreCase("name")) {
if (value != null && ((String) value).length() > 255) {
throw new QueryException("name is too long");
}
project.setName((String) value);
} else if (fieldName.equalsIgnoreCase("notifyEmail")) {
project.setNotifyEmail(stringValue);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment