Trim assignees
Be nice to users that overlook whitespace-only input. Change-Id: I703f6b56f711a90b3ad065c0be16a9ba36ec607c Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
@@ -113,6 +113,8 @@ public class Assignee extends Composite {
|
||||
if (currentAssignee != null) {
|
||||
suggestBox.setText(FormatUtil.nameEmail(currentAssignee));
|
||||
suggestBox.selectAll();
|
||||
} else {
|
||||
suggestBox.setText("");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,7 +139,7 @@ public class Assignee extends Composite {
|
||||
}
|
||||
|
||||
private void editAssignee(final String assignee) {
|
||||
if (assignee.isEmpty()) {
|
||||
if (assignee.trim().isEmpty()) {
|
||||
ChangeApi.deleteAssignee(changeId.get(),
|
||||
new GerritCallback<AccountInfo>() {
|
||||
@Override
|
||||
|
@@ -14,7 +14,6 @@
|
||||
|
||||
package com.google.gerrit.server.change;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.gerrit.common.TimeUtil;
|
||||
import com.google.gerrit.extensions.api.changes.AddReviewerInput;
|
||||
import com.google.gerrit.extensions.api.changes.AssigneeInput;
|
||||
@@ -65,7 +64,7 @@ public class PutAssignee implements
|
||||
if (!rsrc.getControl().canEditAssignee()) {
|
||||
throw new AuthException("Changing Assignee not permitted");
|
||||
}
|
||||
if (Strings.isNullOrEmpty(input.assignee)) {
|
||||
if (input.assignee == null || input.assignee.trim().isEmpty()) {
|
||||
throw new BadRequestException("missing assignee field");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user