Skip to content

Commit

Permalink
[#49116] Internal error occurs when invalid project is set to template
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Jul 13, 2023
1 parent dbbbb28 commit 8a68a67
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/controllers/projects/templated_controller.rb
Expand Up @@ -48,10 +48,15 @@ def change_templated_action(templated)

if service_call.success?
flash[:notice] = t(:notice_successful_update)
redirect_to project_settings_general_path(@project)
else
@errors = service_call.errors
render template: 'projects/settings/general'
messages = [
t('activerecord.errors.template.header', model: Project.model_name.human, count: service_call.errors.count),
service_call.message
]

flash[:error] = messages.join(". ")
end

redirect_to project_settings_general_path(@project)
end
end

0 comments on commit 8a68a67

Please sign in to comment.