Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
rhbz996388 - move some work after validation is done
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Huang committed Aug 15, 2013
1 parent bcb89c0 commit ef9cdda
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -89,14 +89,15 @@ public AddReviewCommentResult execute(AddReviewCommentAction action, ExecutionCo
WorkspaceId workspaceId = action.getWorkspaceId();
securityServiceImpl.checkWorkspaceStatus(workspaceId);

HLocale hLocale = localeServiceImpl.getByLocaleId(workspaceId.getLocaleId());
TranslationWorkspace workspace = translationWorkspaceManager.getOrRegisterWorkspace(workspaceId);

HTextFlowTarget hTextFlowTarget = textFlowTargetDAO.getTextFlowTarget(action.getTransUnitId().getValue(), workspaceId.getLocaleId());
if (hTextFlowTarget == null || hTextFlowTarget.getState().isUntranslated())
{
throw new ActionException("comment on untranslated message is pointless!");
}

HLocale hLocale = localeServiceImpl.getByLocaleId(workspaceId.getLocaleId());
TranslationWorkspace workspace = translationWorkspaceManager.getOrRegisterWorkspace(workspaceId);

HTextFlowTargetReviewComment hComment = hTextFlowTarget.addReviewComment(action.getContent(), authenticatedAccount.getPerson());
textFlowTargetDAO.makePersistent(hTextFlowTarget);
textFlowTargetDAO.flush();
Expand Down

0 comments on commit ef9cdda

Please sign in to comment.