Commit 4a3dc4a5 authored by Gabriel Mazetto's avatar Gabriel Mazetto Committed by Ash McKenzie

Use `Gitlab::Geo.license_allows?` instead of checking license manually

parent c232c440
......@@ -55,7 +55,7 @@ module EE
attrs << { compliance_frameworks: [] }
end
if ::License.feature_available?(:geo) && ::Feature.enabled?(:maintenance_mode)
if ::Gitlab::Geo.license_allows? && ::Feature.enabled?(:maintenance_mode)
attrs << :maintenance_mode
attrs << :maintenance_mode_message
end
......
......@@ -20,8 +20,8 @@ module EE
expose :updating_name_disabled_for_users, if: ->(_instance, _opts) { ::License.feature_available?(:disable_name_update_for_users) }
expose :npm_package_requests_forwarding, if: ->(_instance, _opts) { ::License.feature_available?(:packages) }
expose :group_owners_can_manage_default_branch_protection, if: ->(_instance, _opts) { ::License.feature_available?(:default_branch_protection_restriction_in_groups) }
expose :maintenance_mode, if: ->(_instance, _opts) { ::License.feature_available?(:geo) && ::Feature.enabled?(:maintenance_mode) }
expose :maintenance_mode_message, if: ->(_instance, _opts) { ::License.feature_available?(:geo) && ::Feature.enabled?(:maintenance_mode) }
expose :maintenance_mode, if: ->(_instance, _opts) { ::Gitlab::Geo.license_allows? && ::Feature.enabled?(:maintenance_mode) }
expose :maintenance_mode_message, if: ->(_instance, _opts) { ::Gitlab::Geo.license_allows? && ::Feature.enabled?(:maintenance_mode) }
end
end
end
......
......@@ -47,7 +47,7 @@ module EE
attrs = attrs.except(:group_owners_can_manage_default_branch_protection)
end
unless ::License.feature_available?(:geo) && ::Feature.enabled?(:maintenance_mode)
unless ::Gitlab::Geo.license_allows? && ::Feature.enabled?(:maintenance_mode)
attrs = attrs.except(:maintenance_mode, :maintenance_mode_message)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment