From ee351198f531d5e2e26dac8c505cdd2261c1fe38 Mon Sep 17 00:00:00 2001 From: Sebastian Serth Date: Thu, 2 Nov 2023 00:17:34 +0100 Subject: [PATCH] Fix CommunitySolution after introduction of programming pairs --- app/controllers/community_solutions_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/community_solutions_controller.rb b/app/controllers/community_solutions_controller.rb index 61c91c4c..b909f075 100644 --- a/app/controllers/community_solutions_controller.rb +++ b/app/controllers/community_solutions_controller.rb @@ -52,6 +52,7 @@ class CommunitySolutionsController < ApplicationController def update authorize! contribution_params = submission_params + contribution_params[:user] = current_user cause = contribution_params.delete(:cause) contribution_params[:proposed_changes] = cause == 'change-community-solution' contribution_params[:autosave] = cause == 'autosave-community-solution' @@ -78,7 +79,7 @@ class CommunitySolutionsController < ApplicationController contribution_params[:community_solution_lock] = @community_solution_lock contribution_params[:working_time] = @community_solution_lock.working_time - CommunitySolutionContribution.create(contribution_params) + CommunitySolutionContribution.create(contribution_params.except(:contributor, :exercise)) redirect_after_submit end