0
0
Fork 0

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
This commit is contained in:
Claire 2022-02-16 22:29:48 +01:00 committed by GitHub
parent aa86cf9557
commit ac99f586bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

@ -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