diff --git a/publisher-web/app/controllers/Groups.java b/publisher-web/app/controllers/Groups.java index 4dc75fc39..535d6c7ad 100644 --- a/publisher-web/app/controllers/Groups.java +++ b/publisher-web/app/controllers/Groups.java @@ -138,9 +138,7 @@ public static Promise submitCreateUpdate () { final Form form = Form.form (GroupForm.class).bindFromRequest (); final String name = form.field ("name").valueOr (null); - if (name == null) { - return performCreateUpdate(database, form); - } else { + if (form.field("id").value().equals(ID) && name != null) { return from (database) .query (new ValidateUniqueName (name)) .executeFlat (validationResult -> { @@ -166,6 +164,8 @@ public static Promise submitCreateUpdate () { return performCreateUpdate (database, form); }); + } else { + return performCreateUpdate (database, form); } } diff --git a/publisher-web/app/controllers/Layers.java b/publisher-web/app/controllers/Layers.java index cbbc5b23c..65ac9c1ce 100644 --- a/publisher-web/app/controllers/Layers.java +++ b/publisher-web/app/controllers/Layers.java @@ -141,9 +141,7 @@ public static Promise submitCreateUpdate () { Logger.debug ("performing unique check for name: " + name); - if (name == null) { - return performCreateUpdate (database, form); - } else { + if (form.field("id").value().equals(ID) && name != null) { return from (database) .query (new ValidateUniqueName (name)) .executeFlat (validationResult -> { @@ -169,6 +167,8 @@ public static Promise submitCreateUpdate () { return performCreateUpdate (database, form); }); + } else { + return performCreateUpdate (database, form); } }