Browse Source

remove reminder comments

pull/1568/head
Arthur Campbell 3 years ago
parent
commit
829b7880a5
  1. 2
      app/controllers/sales_logs_controller.rb
  2. 8
      app/models/form_handler.rb

2
app/controllers/sales_logs_controller.rb

@ -44,7 +44,7 @@ class SalesLogsController < LogsController
end end
def email_csv def email_csv
all_orgs = params["organisation_select"] == "all" # what's this for? params['organisation_select'] appears to always be nil all_orgs = params["organisation_select"] == "all"
EmailCsvJob.perform_later(current_user, search_term, @session_filters, all_orgs, nil, codes_only_export?, "sales") EmailCsvJob.perform_later(current_user, search_term, @session_filters, all_orgs, nil, codes_only_export?, "sales")
redirect_to csv_confirmation_sales_logs_path redirect_to csv_confirmation_sales_logs_path
end end

8
app/models/form_handler.rb

@ -40,14 +40,6 @@ class FormHandler
} }
end end
# there is a problem with this that is potentially more general, which is what we plan to do about
# forms that are 2+ years old.
# eg. if there is a question/attribute on the 21/22 form that no longer exists, we will not export that already
# What is the status of old forms on the web app? I believe we are not allowed to edit but are we allowed to view?
# If yes that might be a problem.
# If not I suggest that it might be easier in this method to replace line 1 with:
# sales_forms = [2021..2023].each { |year| Form.new(nil, year, SALES_SECTIONS, sales) }
# sidenote, why do we save a reference to the next years sales log in the FormHandler?
def ordered_sales_questions_for_all_years def ordered_sales_questions_for_all_years
sales_forms = forms.filter { |name, _form| name.end_with? "sales" }.values sales_forms = forms.filter { |name, _form| name.end_with? "sales" }.values
ordered_questions = sales_forms.pop.questions.uniq(&:id) ordered_questions = sales_forms.pop.questions.uniq(&:id)

Loading…
Cancel
Save