@@ -2,15 +2,13 @@ module Forms
22 class WelshTranslationController < FormsController
33 def new
44 authorize current_form , :can_edit_form?
5- return redirect_to form_path ( current_form ) unless welsh_enabled?
65
76 @welsh_translation_input = WelshTranslationInput . new ( form : form_with_pages_and_conditions ) . assign_form_values
87 @table_presenter = Forms ::TranslationTablePresenter . new
98 end
109
1110 def create
1211 authorize current_form , :can_edit_form?
13- return redirect_to form_path ( current_form ) unless welsh_enabled?
1412
1513 @welsh_translation_input = WelshTranslationInput . new ( welsh_translation_params )
1614 @table_presenter = Forms ::TranslationTablePresenter . new
@@ -30,14 +28,12 @@ def create
3028
3129 def delete
3230 authorize current_form , :can_edit_form?
33- return redirect_to form_path ( current_form ) unless welsh_enabled?
3431
3532 @delete_welsh_translation_input = Forms ::DeleteWelshTranslationInput . new ( form : current_form )
3633 end
3734
3835 def destroy
3936 authorize current_form , :can_edit_form?
40- return redirect_to form_path ( current_form ) unless welsh_enabled?
4137
4238 @delete_welsh_translation_input = Forms ::DeleteWelshTranslationInput . new ( delete_welsh_translation_params )
4339
@@ -66,10 +62,6 @@ def preview_html
6662 GovukFormsMarkdown . render ( params [ :markdown ] , locale : "cy" )
6763 end
6864
69- def welsh_enabled?
70- FeatureService . new ( group : current_form . group ) . enabled? ( :welsh )
71- end
72-
7365 def welsh_translation_params
7466 params . require ( :forms_welsh_translation_input ) . permit (
7567 *WelshTranslationInput . attribute_names ,
0 commit comments