mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-13 21:13:19 +00:00
Make workflow curation tasks actually work.
When curation runs, there was no "current user" and no claimed task, so the code broke when trying to find people to notify about curation failures.
This commit is contained in:
@@ -47,6 +47,7 @@ import org.dspace.eperson.service.GroupService;
|
||||
import org.dspace.eperson.service.SubscribeService;
|
||||
import org.dspace.event.Event;
|
||||
import org.dspace.orcid.service.OrcidTokenService;
|
||||
import org.dspace.services.ConfigurationService;
|
||||
import org.dspace.util.UUIDUtils;
|
||||
import org.dspace.versioning.Version;
|
||||
import org.dspace.versioning.VersionHistory;
|
||||
@@ -101,6 +102,8 @@ public class EPersonServiceImpl extends DSpaceObjectServiceImpl<EPerson> impleme
|
||||
protected VersionDAO versionDAO;
|
||||
@Autowired(required = true)
|
||||
protected ClaimedTaskService claimedTaskService;
|
||||
@Autowired(required = true)
|
||||
protected ConfigurationService configurationService;
|
||||
@Autowired
|
||||
protected OrcidTokenService orcidTokenService;
|
||||
|
||||
@@ -113,6 +116,21 @@ public class EPersonServiceImpl extends DSpaceObjectServiceImpl<EPerson> impleme
|
||||
return ePersonDAO.findByID(context, EPerson.class, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EPerson findAnAdministrator(Context c)
|
||||
throws SQLException {
|
||||
List<EPerson> contacts = groupService.findByName(c, Group.ADMIN).getMembers();
|
||||
EPerson currentUser;
|
||||
if (contacts.isEmpty()) {
|
||||
log.warn("Administrators group is empty");
|
||||
currentUser = findByEmail(c, configurationService.getProperty("mail.admin"));
|
||||
// Null if no such EPerson
|
||||
} else {
|
||||
currentUser = contacts.get(0);
|
||||
}
|
||||
return currentUser;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EPerson findByIdOrLegacyId(Context context, String id) throws SQLException {
|
||||
if (StringUtils.isNumeric(id)) {
|
||||
|
Reference in New Issue
Block a user