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

Ignore facets that are set to empty strings #340

Merged
merged 1 commit into from May 3, 2017
Merged

Conversation

@fofr
Copy link
Contributor

@fofr fofr commented May 3, 2017

If a facet has no value, ignore it.

Fixes:

Seen on staging, a CMA case has a date facet set to an empty string:
https://www.gov.uk/api/content/cma-cases/midcounties-co-operative-harry-tuffin-investments
"opened_date": “”
Object must be a Date, DateTime or Time object. nil given.

See also:
https://www.gov.uk/api/content/cma-cases/higher-education-sector-call-for-information
"outcome_type": "",
Gives:

{
  "error_message" => "Facet value '' not an allowed value for facet 'Outcome' on /cma-cases/higher-education-sector-call-for-information content item"
}
Seen on staging, a CMA case has a date facet set to an empty string:
https://www.gov.uk/api/content/cma-cases/midcounties-co-operative-harry-
tuffin-investments

`"opened_date": ""`

This leads to the error:
Object must be a Date, DateTime or Time object. nil given.

If a facet has no value, ignore it.
@boffbowsh boffbowsh temporarily deployed to government-frontend-pr-340 May 3, 2017 Inactive
@mcgoooo
mcgoooo approved these changes May 3, 2017
@mcgoooo mcgoooo merged commit 14df809 into master May 3, 2017
2 checks passed
2 checks passed
continuous-integration/jenkins/branch This commit looks good
Details
security/snyk No new vulnerabilities
Details
@mcgoooo mcgoooo deleted the empty-date-dacets branch May 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.