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

fix: if there is no custom style, create it

as-opc31650528446
diff --git a/app/controllers/custom_styles_controller.rb b/app/controllers/custom_styles_controller.rb
index 3fdf20f015b..2ffa180ae68 100644
--- a/app/controllers/custom_styles_controller.rb
+++ b/app/controllers/custom_styles_controller.rb
@@ -66,13 +66,8 @@ class CustomStylesController < ApplicationController
end
def update_export_cover_text_color
+ @custom_style = get_or_create_custom_style
color = params[:export_cover_text_color]
-
- @custom_style = CustomStyle.current
- if @custom_style.nil?
- return render_404
- end
-
color_hexcode_regex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/
color = nil if color.blank?
if color.nil? || color.match(color_hexcode_regex)