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

Deal with blank company_nos correctly. #56

Merged
merged 2 commits into from
Jan 29, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion app/forms/registration_number_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def submit(params)
# Assign the params for validation and pass them to the BaseForm method for updating
# If param isn't set, use a blank string instead to avoid errors with the validator
self.company_no = params[:company_no] || ""
self.company_no = process_company_no(company_no)
self.company_no = process_company_no(company_no) if company_no.present?
attributes = { company_no: company_no }

super(attributes, params[:reg_identifier])
Expand Down
1 change: 1 addition & 0 deletions config/locales/forms/registration_number_forms/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ en:
inactive: "Your company must be registered as an active company"
not_found: "Companies House couldn't find a company with this number"
error: "There was an error with Companies House"
blank: "Enter a company registration number"
reg_identifier:
invalid_format: "The registration ID is not in a valid format"
no_registration: "There is no registration matching this ID"
Expand Down