Skip to content
Snippets Groups Projects
Commit 139afe6b authored by Mike McKay's avatar Mike McKay
Browse files

Minor fixes

parent 772a92c5
No related branches found
No related tags found
No related merge requests found
File added
File added
File added
File added
File added
File added
File added
File added
File added
...@@ -45,7 +45,10 @@ public class SiteConfigApi extends AbstractXapiRestController { ...@@ -45,7 +45,10 @@ public class SiteConfigApi extends AbstractXapiRestController {
@PostConstruct @PostConstruct
public void checkForFoundPreferences() { public void checkForFoundPreferences() {
if (!_appInfo.isInitialized()) { if (!_appInfo.isInitialized()) {
_found.putAll(_appInfo.getFoundPreferences()); Map<String, String> tempPrefs = _appInfo.getFoundPreferences();
if(tempPrefs!=null){
_found.putAll(tempPrefs);
}
if (_found.size() > 0) { if (_found.size() > 0) {
_hasFoundPreferences = true; _hasFoundPreferences = true;
} }
......
...@@ -62,8 +62,8 @@ public class ApplicationConfig { ...@@ -62,8 +62,8 @@ public class ApplicationConfig {
} }
@Bean @Bean
public AutomationPreferences automationPreferences(final NrgEventService service) { public AutomationPreferences automationPreferences(final NrgPreferenceService preferenceService, final NrgEventService service) {
return new AutomationPreferences(service); return new AutomationPreferences(preferenceService, service);
} }
@Bean @Bean
......
...@@ -4,6 +4,7 @@ import org.nrg.framework.services.NrgEventService; ...@@ -4,6 +4,7 @@ import org.nrg.framework.services.NrgEventService;
import org.nrg.prefs.annotations.NrgPreference; import org.nrg.prefs.annotations.NrgPreference;
import org.nrg.prefs.annotations.NrgPreferenceBean; import org.nrg.prefs.annotations.NrgPreferenceBean;
import org.nrg.prefs.exceptions.InvalidPreferenceName; import org.nrg.prefs.exceptions.InvalidPreferenceName;
import org.nrg.prefs.services.NrgPreferenceService;
import org.nrg.xdat.preferences.EventTriggeringAbstractPreferenceBean; import org.nrg.xdat.preferences.EventTriggeringAbstractPreferenceBean;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
...@@ -18,8 +19,8 @@ public class AutomationPreferences extends EventTriggeringAbstractPreferenceBean ...@@ -18,8 +19,8 @@ public class AutomationPreferences extends EventTriggeringAbstractPreferenceBean
public static final String AUTOMATION_TOOL_ID = "automation"; public static final String AUTOMATION_TOOL_ID = "automation";
@Autowired @Autowired
public AutomationPreferences(final NrgEventService eventService) { public AutomationPreferences(final NrgPreferenceService preferenceService, final NrgEventService eventService) {
super(eventService); super(preferenceService, eventService);
} }
@NrgPreference(defaultValue = "true") @NrgPreference(defaultValue = "true")
......
...@@ -29,6 +29,7 @@ public class AcceptProjectAccess extends SecureAction { ...@@ -29,6 +29,7 @@ public class AcceptProjectAccess extends SecureAction {
@Override @Override
public void doPerform(RunData data, Context context) throws Exception { public void doPerform(RunData data, Context context) throws Exception {
UserI user = (UserI) context.get("user"); //Check the user in the context before XDAT.getUserDetails() because XDAT.getUserDetails() may still be the guest user at this point. UserI user = (UserI) context.get("user"); //Check the user in the context before XDAT.getUserDetails() because XDAT.getUserDetails() may still be the guest user at this point.
if (user == null) { if (user == null) {
user = XDAT.getUserDetails(); user = XDAT.getUserDetails();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment