Fixed sending workflow emails to previous assignee (#422)

This commit is contained in:
buherman11 2020-06-10 17:04:09 +07:00 committed by GitHub
parent e474e7cd75
commit 35339f7328
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -209,7 +209,9 @@ public class RouteResource extends BaseResource {
routeStepDao.endRouteStep(routeStepDto.getId(), routeStepTransition, comment, principal.getId()); routeStepDao.endRouteStep(routeStepDto.getId(), routeStepTransition, comment, principal.getId());
RouteStepDto newRouteStep = routeStepDao.getCurrentStep(documentId); RouteStepDto newRouteStep = routeStepDao.getCurrentStep(documentId);
RoutingUtil.updateAcl(documentId, newRouteStep, routeStepDto, principal.getId()); RoutingUtil.updateAcl(documentId, newRouteStep, routeStepDto, principal.getId());
RoutingUtil.sendRouteStepEmail(documentId, routeStepDto); if (newRouteStep != null) {
RoutingUtil.sendRouteStepEmail(documentId, newRouteStep);
}
JsonObjectBuilder response = Json.createObjectBuilder() JsonObjectBuilder response = Json.createObjectBuilder()
.add("readable", aclDao.checkPermission(documentId, PermType.READ, getTargetIdList(null))); .add("readable", aclDao.checkPermission(documentId, PermType.READ, getTargetIdList(null)));

View File

@ -226,7 +226,7 @@ public class TestRouteResource extends BaseJerseyTest {
.param("transition", "APPROVED")), JsonObject.class); .param("transition", "APPROVED")), JsonObject.class);
Assert.assertFalse(json.containsKey("route_step")); Assert.assertFalse(json.containsKey("route_step"));
Assert.assertTrue(json.getBoolean("readable")); // Admin can read everything Assert.assertTrue(json.getBoolean("readable")); // Admin can read everything
Assert.assertTrue(popEmail().contains("workflow step")); Assert.assertNull(popEmail()); // Last step does not send any email
// Get the route on document 1 // Get the route on document 1
json = target().path("/route") json = target().path("/route")