Commit 8d3c6534 authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'issue_342492_MR_create_from_vulnerability_data_service' into 'master'

Pass formats explicitly when rendering .md file

See merge request gitlab-org/gitlab!75781
parents b0e34aef a4dc45e3
...@@ -68,6 +68,7 @@ module MergeRequests ...@@ -68,6 +68,7 @@ module MergeRequests
# This currently applies only the first diff # This currently applies only the first diff
render_template( render_template(
file: 'vulnerabilities/remediation', file: 'vulnerabilities/remediation',
formats: :patch,
locals: { locals: {
diff: diffs.first, diff: diffs.first,
head_commit: head_commit, head_commit: head_commit,
...@@ -80,12 +81,13 @@ module MergeRequests ...@@ -80,12 +81,13 @@ module MergeRequests
def render_description(vulnerability) def render_description(vulnerability)
render_template( render_template(
file: 'vulnerabilities/merge_request_description', file: 'vulnerabilities/merge_request_description',
formats: :md,
locals: { vulnerability: vulnerability } locals: { vulnerability: vulnerability }
) )
end end
def render_template(file:, locals:) def render_template(file:, locals:, formats:)
ActionController::Base.new.render_to_string(template: file, locals: locals) ApplicationController.render(template: file, locals: locals, formats: formats)
end end
def can_create_merge_request?(source_branch) def can_create_merge_request?(source_branch)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment