mirror of
https://github.com/docusealco/docuseal
synced 2026-11-16 08:12:32 -05:00
add with order check
This commit is contained in:
1 parent
4702a68ad1
commit
4fb3e5bd47
1 file changed
+6
-1
@@ -51,7 +51,7 @@ class SubmitFormController < ApplicationController
|
||||
end
|
||||
|
||||
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') },
|
||||
status: :unprocessable_content
|
||||
end
|
||||
@@ -154,6 +154,11 @@ class SubmitFormController < ApplicationController
|
||||
.preload(:blob).index_by(&:uuid)
|
||||
end
|
||||
|
||||
def with_order(submitter)
|
||||
params[:completed] == 'true' && submitter.present? &&
|
||||
submitter.submission.template&.preferences&.dig('submitters_order') == 'preserved'
|
||||
end
|
||||
|
||||
def lang
|
||||
params[:lang].presence
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user