97425: Fix issue with sessions null value

This commit is contained in:
Yana De Pauw
2023-01-23 17:22:32 +01:00
parent f03d5ff0a6
commit 51424cbb7c
3 changed files with 4 additions and 4 deletions

View File

@@ -106,8 +106,8 @@ public class SystemWideAlert implements ReloadableEntity<Integer> {
*
* @param allowSessions Integer representing what kind of sessions are allowed
*/
public void setAllowSessions(final int allowSessions) {
this.allowSessions = allowSessions;
public void setAllowSessions(AllowSessionsEnum allowSessions) {
this.allowSessions = allowSessions.getValue();
}
/**

View File

@@ -45,7 +45,7 @@ public class SystemWideAlertServiceImpl implements SystemWideAlertService {
final Date countdownTo, final boolean active) throws SQLException {
SystemWideAlert systemWideAlert = new SystemWideAlert();
systemWideAlert.setMessage(message);
systemWideAlert.setAllowSessions(allowSessionsType.getValue());
systemWideAlert.setAllowSessions(allowSessionsType);
systemWideAlert.setCountdownTo(countdownTo);
systemWideAlert.setActive(active);

View File

@@ -105,7 +105,7 @@ public class SystemWideAlertRestRepository extends DSpaceRestRepository<SystemWi
}
systemWideAlert.setMessage(systemWideAlertRest.getMessage());
systemWideAlert.setAllowSessions(systemWideAlertRest.getAllowSessions());
systemWideAlert.setAllowSessions(AllowSessionsEnum.fromInt(systemWideAlertRest.getAllowSessions()));
systemWideAlert.setCountdownTo(systemWideAlertRest.getCountdownTo());
systemWideAlert.setActive(systemWideAlertRest.isActive());