Skip to content

Commit

Permalink
Update handling of default template in dropdown
Browse files Browse the repository at this point in the history
This change resolves #1013
Before this change, `!customization.upgrade_customization?` was applied to all templates populating the dropdown, except the default template. As a result, if an organization had customized and published an older version of the default template, but not the newest version, that newest version would be blocked from being populated in the dropdown.
  • Loading branch information
aaronskiba committed Feb 20, 2025
1 parent f31c3fe commit e859e95
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/template_options_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def index
# Always use the default template
if Template.default.present? && org.present?
customization = Template.published.latest_customized_version(Template.default.family_id, org.id).first
customization ||= Template.default
customization = Template.default unless customization.present? && !customization.upgrade_customization?
@templates.select! { |t| t.id != Template.default.id && t.id != customization.id }
# We want the default template to appear at the beggining of the list
@templates.unshift(customization)
Expand Down

0 comments on commit e859e95

Please sign in to comment.