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

only perform unique name check for new items #692

Merged
merged 1 commit into from
Jun 9, 2015
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions publisher-web/app/controllers/Groups.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ public static Promise<Result> submitCreateUpdate () {
final Form<GroupForm> 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 -> {
Expand All @@ -166,6 +164,8 @@ public static Promise<Result> submitCreateUpdate () {

return performCreateUpdate (database, form);
});
} else {
return performCreateUpdate (database, form);
}
}

Expand Down
6 changes: 3 additions & 3 deletions publisher-web/app/controllers/Layers.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ public static Promise<Result> 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 -> {
Expand All @@ -169,6 +167,8 @@ public static Promise<Result> submitCreateUpdate () {

return performCreateUpdate (database, form);
});
} else {
return performCreateUpdate (database, form);
}
}

Expand Down