Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't mark strings as safe. #176

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/model_patches.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ def survey
UserInfoRequestSentAlert._validate_callbacks[0].options[:in] << 'survey_1'

InfoRequest.class_eval do
def email_subject_request
if (!self.is_batch_request_template?) && (self.public_body.url_name == 'general_register_office')
def email_subject_request(opts = {})
html = opts.fetch(:html, true)
subject_title = html ? self.title : self.title.html_safe
if (!is_batch_request_template?) && (public_body.url_name == 'general_register_office')
# without GQ in the subject, you just get an auto response
_('{{law_used_full}} request GQ - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title.html_safe)
_('{{law_used_full}} request GQ - {{title}}', :law_used_full => law_used_full,
:title => subject_title)
else
_('{{law_used_full}} request - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title.html_safe)
_('{{law_used_full}} request - {{title}}', :law_used_full => law_used_full,
:title => subject_title)
end
end
end
Expand Down