diff --git a/grails-app/controllers/au/org/ala/merit/OrganisationController.groovy b/grails-app/controllers/au/org/ala/merit/OrganisationController.groovy index 702e2145e..e92cc0847 100644 --- a/grails-app/controllers/au/org/ala/merit/OrganisationController.groovy +++ b/grails-app/controllers/au/org/ala/merit/OrganisationController.groovy @@ -83,11 +83,12 @@ class OrganisationController { List scores = services.collect{it.scores}.flatten() dashboardData = organisationService.scoresForOrganisation(organisation, scores?.collect{it.scoreId}, !hasEditorAccess) } - boolean showTargets = userService.userIsSiteAdmin() && services && targetPeriods + boolean hasTargets = services && targetPeriods + boolean showTargets = hasTargets && userService.userIsSiteAdmin() // This call is used to ensure the organisation funding total is kept up to date as the algorithm // for selecting the current total is based on the current date. The funding total is used when // calculating data for the dashboard. - if (showTargets) { + if (hasTargets) { organisationService.checkAndUpdateFundingTotal(organisation) } boolean targetsEditable = userService.userIsAlaOrFcAdmin() diff --git a/grails-app/services/au/org/ala/merit/OrganisationService.groovy b/grails-app/services/au/org/ala/merit/OrganisationService.groovy index 06dae7f8d..d2a5bd983 100644 --- a/grails-app/services/au/org/ala/merit/OrganisationService.groovy +++ b/grails-app/services/au/org/ala/merit/OrganisationService.groovy @@ -208,7 +208,7 @@ class OrganisationService { rcsFunding.rowTotal = funding organisation.custom.details.funding.overallTotal = rcsFunding.rowTotal log.info("Updating the funding information for organisation ${organisation.organisationId} to $funding") - update(organisation.organisationId, organisation.custom) + update(organisation.organisationId, [custom:organisation.custom]) } }