Skip to content

Commit 0b83ad3

Browse files
authored
Merge branch 'development' into remove_vulnerability_XSS_hack
2 parents bd07ca7 + dab960f commit 0b83ad3

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

Diff for: app/models/concerns/exportable_plan.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ def prepare_coversheet_for_csv(csv, _headings, hash)
138138
else
139139
[_("Template: "), _("%{template}") % { template: hash[:template] + hash[:customizer] }]
140140
end
141-
if grant_number.present?
142-
csv << [_("Grant number: "), _("%{grant_number}") % { grant_number: grant_number }]
141+
if grant&.value.present?
142+
csv << [_("Grant number: "), _("%{grant_number}") % { grant_number: grant&.value }]
143143
end
144144
if description.present?
145145
csv << [_("Project abstract: "), _("%{description}") %

Diff for: app/models/exported_plan.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def project_identifier
4646
end
4747

4848
def grant_title
49-
plan.grant_number
49+
plan.grant&.value
5050
end
5151

5252
def principal_investigator

Diff for: app/views/api/v0/plans/index.json.jbuilder

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ json.prettify!
88
json.array! @plans.each do |plan|
99
json.id plan.id
1010
json.title plan.title
11-
json.grant_number plan.grant_number
11+
json.grant_number plan.grant&.value
1212
json.last_updated plan.updated_at
1313
json.creation_date plan.created_at
1414
json.test_plan plan.is_test?

Diff for: app/views/api/v0/statistics/plans.json.jbuilder

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ json.prettify!
44

55
json.plans @org_plans.each do |plan|
66
json.id plan.id
7-
json.grant_number plan.grant_number
7+
json.grant_number plan.grant&.value
88
json.title plan.title
99
json.test_plan plan.is_test?
1010

Diff for: app/views/shared/export/_plan_txt.erb

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<% else %>
99
<%= _("Template: ") + @hash[:template] + @hash[:customizer] %>
1010
<% end %>
11-
<% if @plan.grant_number.present? %>
12-
<%= _("Grant number: ") + @plan.grant_number %>
11+
<% if @plan.grant&.value.present? %>
12+
<%= _("Grant number: ") + @plan.grant&.value %>
1313
<% end %>
1414
<% if @plan.description.present? %>
1515
<%= _("Project abstract: ") %>
@@ -31,7 +31,7 @@
3131
<%= "#{section[:title]}\n" %>
3232
<% end %>
3333
<% section[:questions].each do |question| %>
34-
<% if remove_list(@plan).include?(question[:id]) %>
34+
<% if remove_list(@plan).include?(question[:id]) %>
3535
<% next %>
3636
<% end %>
3737
<%# text in this case is an array to accomodate for option_based %>

0 commit comments

Comments
 (0)