add with order check

This commit is contained in:
Pete Matsyburka committed 2026-11-12 14:58:14 +02:00
1 parent 4702a68ad1
commit 4fb3e5bd47
1 file changed
+6 -1
+6 -1
View File
@@ -51,7 +51,7 @@ class SubmitFormController < ApplicationController
end end
def update def update
unless Submitters::AuthorizedForForm.call(@submitter, current_user, request) unless Submitters::AuthorizedForForm.call(@submitter, current_user, request, with_order: with_order(@submitter))
return render json: { error: I18n.t('verification_required_refresh_the_page_and_pass_2fa') }, return render json: { error: I18n.t('verification_required_refresh_the_page_and_pass_2fa') },
status: :unprocessable_content status: :unprocessable_content
end end
@@ -154,6 +154,11 @@ class SubmitFormController < ApplicationController
.preload(:blob).index_by(&:uuid) .preload(:blob).index_by(&:uuid)
end end
def with_order(submitter)
params[:completed] == 'true' && submitter.present? &&
submitter.submission.template&.preferences&.dig('submitters_order') == 'preserved'
end
def lang def lang
params[:lang].presence params[:lang].presence
end end