mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
allow deleting calculated value custom fields without enterprise token
This commit is contained in:
@@ -53,6 +53,10 @@ module CustomFields
|
||||
|
||||
validate :not_referenced
|
||||
|
||||
def validate_model?
|
||||
false
|
||||
end
|
||||
|
||||
def not_referenced
|
||||
referencing = model.class.with_formula_referencing(model)
|
||||
return if referencing.empty?
|
||||
|
||||
@@ -60,4 +60,11 @@ RSpec.describe CustomFields::DeleteContract do
|
||||
include_examples "contract is invalid", base: :referenced_in_other_fields
|
||||
end
|
||||
end
|
||||
|
||||
describe "allows deleting a calculated_value field without an enterprise token" do
|
||||
let(:current_user) { build_stubbed(:admin) }
|
||||
let(:cf) { build_stubbed(:project_custom_field, field_format: "calculated_value") }
|
||||
|
||||
include_examples "contract is valid"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user