diff --git a/CHANGELOG.md b/CHANGELOG.md index acbade9fd..37e47778f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ # Changelog Fab-manager +- Auto sync projects to OpenLab if set openlab_app_id and openlab_app_secret - Fix a bug: back bouton can't return to previously page in projects page (list/new/show/edit) - Fix a security issue: updated async to 2.6.4 to fix [CVE-2021-43138](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-43138) - Fix a bug on OpenLab Projects, if you are using OpenLab Projects, please follow the following TODO DEPLOY diff --git a/app/services/setting_service.rb b/app/services/setting_service.rb index 5b458cfb8..2a74fd1b9 100644 --- a/app/services/setting_service.rb +++ b/app/services/setting_service.rb @@ -23,5 +23,12 @@ class SettingService # generate statistics PeriodStatisticsWorker.perform_async(setting.previous_update) if setting.name == 'statistics_module' && setting.value == 'true' + + # export projects to openlab + if %w[openlab_app_id openlab_app_secret].include? setting.name + if Setting.get('openlab_app_id').present? && Setting.get('openlab_app_secret').present? + Project.all.each { |pr| pr.openlab_create } + end + end end end