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
# This currently applies only the first diff
render_template(
file: 'vulnerabilities/remediation',
formats: :patch,
locals: {
diff: diffs.first,
head_commit: head_commit,
......@@ -80,12 +81,13 @@ module MergeRequests
def render_description(vulnerability)
render_template(
file: 'vulnerabilities/merge_request_description',
formats: :md,
locals: { vulnerability: vulnerability }
)
end
def render_template(file:, locals:)
ActionController::Base.new.render_to_string(template: file, locals: locals)
def render_template(file:, locals:, formats:)
ApplicationController.render(template: file, locals: locals, formats: formats)
end
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