Skip to content

Commit

Permalink
get ReturnDatasetToAuthorCommandTest passing #4124 #4139
Browse files Browse the repository at this point in the history
The relationship between locks and users is confusing. I left a TODO.
  • Loading branch information
pdurbin committed Oct 18, 2017
1 parent ba64c54 commit 5a53fa0
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Future;

@RequiredPermissions(Permission.PublishDataset)
Expand Down Expand Up @@ -63,16 +62,12 @@ public Dataset save(CommandContext ctxt) throws CommandException {
for (DatasetLock lock : theDataset.getLocks()) {
if (DatasetLock.Reason.InReview.equals(lock.getReason())) {
theDataset.removeLock(lock);
// TODO: Are we supposed to remove the dataset lock from the user? What's going on here?
authenticatedUser = lock.getUser();
authenticatedUser.getDatasetLocks().remove(lock);
}
}
Dataset savedDataset = ctxt.em().merge(theDataset);
ctxt.em().flush();
if (authenticatedUser != null) {
// Remove lock from user.
ctxt.em().merge(authenticatedUser);
}

DatasetVersionUser ddu = ctxt.datasets().getDatasetVersionUser(theDataset.getLatestVersion(), this.getUser());

Expand Down

0 comments on commit 5a53fa0

Please sign in to comment.