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

Commit

Permalink
create project REST service will fail on adding maintainer
Browse files Browse the repository at this point in the history
- we flush early and that causes an update when adding the user as maintainer, which then failed on update permission check because he is not yet a maintainer
  • Loading branch information
Patrick Huang committed Aug 6, 2014
1 parent d82b111 commit faa1f5a
Showing 1 changed file with 1 addition and 4 deletions.
Expand Up @@ -169,19 +169,16 @@ else if (Objects.equal(hProject.getStatus(), READONLY)) {

transfer(project, hProject);

hProject = projectDAO.makePersistent(hProject);
projectDAO.flush();

if (identity != null && hProject.getMaintainers().isEmpty()) {
HAccount hAccount =
accountDAO.getByUsername(identity.getCredentials()
.getUsername());
if (hAccount != null && hAccount.getPerson() != null) {
hProject.getMaintainers().add(hAccount.getPerson());
}
projectDAO.flush();
}

projectDAO.makePersistent(hProject);
etag = eTagUtils.generateTagForProject(projectSlug);
return response.tag(etag).build();

Expand Down

0 comments on commit faa1f5a

Please sign in to comment.