about summary refs log tree commit diff
path: root/app/controllers/disputes
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-02-16 22:29:48 +0100
committerGitHub <noreply@github.com>2022-02-16 22:29:48 +0100
commitac99f586bb4138e083676579097d951434e90515 (patch)
tree2ab02a0a811e96052eb0fc41875f1e8d2709f035 /app/controllers/disputes
parentaa86cf955755cd05ed9c274daebbec248c39d863 (diff)
Fix issues when attempting to appeal an old strike (#17554)
* Display an error when an appeal could not be submitted

* Do not offer users to appeal old strikes

* Fix 500 error when trying to appeal a strike that is too old

* Avoid using an extra translatable string
Diffstat (limited to 'app/controllers/disputes')
-rw-r--r--app/controllers/disputes/appeals_controller.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/disputes/appeals_controller.rb b/app/controllers/disputes/appeals_controller.rb
index 15367c879..eefd92b5a 100644
--- a/app/controllers/disputes/appeals_controller.rb
+++ b/app/controllers/disputes/appeals_controller.rb
@@ -9,7 +9,8 @@ class Disputes::AppealsController < Disputes::BaseController
     @appeal = AppealService.new.call(@strike, appeal_params[:text])
 
     redirect_to disputes_strike_path(@strike), notice: I18n.t('disputes.strikes.appealed_msg')
-  rescue ActiveRecord::RecordInvalid
+  rescue ActiveRecord::RecordInvalid => e
+    @appeal = e.record
     render template: 'disputes/strikes/show'
   end