
Merge branch 'issue-2099' of dlab/hive
from pull-request 1467 * refs/heads/issue-2099: Fixed bug that generating assignee-changed-event when editing the issue. Reviewed-by: 채수원
@51668ffa072050212bb0f2ed93c92505cd240755
--- app/controllers/IssueApp.java
+++ app/controllers/IssueApp.java
... | ... | @@ -504,6 +504,7 @@ |
504 | 504 |
} |
505 | 505 |
|
506 | 506 |
final Issue issue = issueForm.get(); |
507 |
+ setAssignee(issueForm, issue, project); |
|
507 | 508 |
removeAnonymousAssignee(issue); |
508 | 509 |
setMilestone(issueForm, issue); |
509 | 510 |
issue.dueDate = JodaDateUtil.lastSecondOfDay(issue.dueDate); |
... | ... | @@ -533,6 +534,16 @@ |
533 | 534 |
return editPosting(originalIssue, issue, issueForm, redirectTo, preUpdateHook); |
534 | 535 |
} |
535 | 536 |
|
537 |
+ private static void setAssignee(Form<Issue> issueForm, Issue issue, Project project) { |
|
538 |
+ String value = issueForm.field("assignee.user.id").value(); |
|
539 |
+ if (value != null) { |
|
540 |
+ long userId = Long.parseLong(value); |
|
541 |
+ if (userId != User.anonymous.id) { |
|
542 |
+ issue.assignee = new Assignee(userId, project.id); |
|
543 |
+ } |
|
544 |
+ } |
|
545 |
+ } |
|
546 |
+ |
|
536 | 547 |
private static void setMilestone(Form<Issue> issueForm, Issue issue) { |
537 | 548 |
String milestoneId = issueForm.data().get("milestoneId"); |
538 | 549 |
if(milestoneId != null && !milestoneId.isEmpty()) { |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?