adjust submitter role assign
This commit is contained in:
@@ -125,9 +125,14 @@ module Submissions
|
|||||||
end
|
end
|
||||||
|
|
||||||
def find_submitter_uuid(template, attrs, index)
|
def find_submitter_uuid(template, attrs, index)
|
||||||
attrs[:uuid].presence ||
|
uuid = attrs[:uuid].presence
|
||||||
template.submitters.find { |e| e['name'] == attrs[:role] }&.dig('uuid') ||
|
uuid ||= template.submitters.find { |e| e['name'].to_s.casecmp(attrs[:role].to_s).zero? }&.dig('uuid')
|
||||||
template.submitters[index]&.dig('uuid')
|
|
||||||
|
if attrs[:role].present? && uuid.blank? && defined?(Rollbar)
|
||||||
|
Rollbar.error("Role doesn't existng: #{attrs[:role]}, #{template.id}")
|
||||||
|
end
|
||||||
|
|
||||||
|
uuid || template.submitters[index]&.dig('uuid')
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_submitter(submission:, attrs:, uuid:, is_order_sent:, mark_as_sent:, user:, preferences:)
|
def build_submitter(submission:, attrs:, uuid:, is_order_sent:, mark_as_sent:, user:, preferences:)
|
||||||
|
|||||||
Reference in New Issue
Block a user