Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

improve error message on unwritable setting assignment

ulferts056fce4b1921
diff --git a/app/models/setting.rb b/app/models/setting.rb
index 384aec6063b..bf013df9e58 100644
--- a/app/models/setting.rb
+++ b/app/models/setting.rb
@@ -157,7 +157,9 @@ class Setting < ApplicationRecord
end
def value=(val)
- raise NoMethodError unless Settings::Definition[name].writable?
+ unless Settings::Definition[name].writable?
+ raise NoMethodError, "#{name} is not writable but can be set through env vars or configuration.yml file."
+ end
write_attribute(:value, formatted_value(val))
end