Skip to content

Commit

Permalink
Fix random stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pskl committed Oct 21, 2024
1 parent 8cbb12c commit 5c120bc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/controllers/schoolings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
class SchoolingsController < ApplicationController
include RoleCheck

before_action :set_schooling, only: [:update]
before_action :authenticate_user!, :set_classe, :set_schooling
before_action :check_director, :update_confirmed_director!, :check_confirmed_director,
only: %i[abrogate_decision update]
Expand All @@ -27,7 +26,7 @@ def confirm_removal; end
def confirm_removal_cancellation; end

def remove
@schooling.update(removed_at: params[:value])
@schooling.update!(removed_at: params[:value])

redirect_to school_year_class_path(selected_school_year, @classe),
notice: t("flash.schooling.removed", name: @schooling.student, classe: @schooling.classe.label)
Expand All @@ -53,7 +52,7 @@ def update # rubocop:disable Metrics/AbcSize
def set_schooling
@schooling = Schooling.find(params[:id])
rescue ActiveRecord::RecordNotFound
redirect_to @classe, alert: t("errors.schoolings.not_found")
redirect_to school_year_classes_path(selected_school_year), alert: t("errors.schoolings.not_found")
end

def schooling_params
Expand Down
2 changes: 2 additions & 0 deletions app/models/student/mappers/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def parse!
begin
map_schooling!(classe, student, entry)
rescue StandardError => e
raise e unless Rails.env.production?

Sentry.capture_exception(
SchoolingParsingError.new(
"Schooling parsing failed for #{uai}: #{e.message}"
Expand Down

0 comments on commit 5c120bc

Please sign in to comment.