Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Throw 404 for missing data #515

Merged
merged 2 commits into from
May 14, 2018
Merged

Conversation

lbeaufort
Copy link
Contributor

Add error handling for missing regulations

Allow site to respond to all hosts

  • Accessing the site was causing an error
  • Previously, we needed to add 0.0.0.0 to ALLOWED_HOSTS manually.

lbeaufort added 2 commits May 14, 2018 10:20
- Addresses issue eregs#485: Missing data leads to an explosion
- Also addresses FEC issue: fecgov/fec-eregs#385

- Throw a 404 error when navigating to a regulation that doesn't exist
- Previously, the `utils.regulation_meta` function was returning `{}`, so accessing the 'meta' data was resulting in a 500 error
- Accessing the site was causing an error
- Previously, we needed to add 0.0.0.0 to `ALLOWED_HOSTS` manually.
Copy link
Member

@cmc333333 cmc333333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff @lbeaufort , thanks for pairing on this!

@cmc333333 cmc333333 merged commit bcbe66e into eregs:master May 14, 2018
@lbeaufort lbeaufort deleted the 404-for-missing-data branch May 14, 2018 21:08
cmc333333 pushed a commit to cmc333333/regulations-site that referenced this pull request May 15, 2018
Bug Fixes
* Ensure compatibility with recent versions of futures/enum34 eregs#516
* Avoid 500 when missing data eregs#515 (thanks to first time contributor,
 @lbeaufort!)
* Fix bug which would turn &section links into §
@cmc333333 cmc333333 mentioned this pull request May 15, 2018
lbeaufort added a commit to fecgov/fec-eregs that referenced this pull request May 15, 2018
- New version 8.4.2 now throws 404 errors instead of 500 errors for missing regulations (eregs/regulations-site#515)
- This will address fec-eregs #385: 404 instead of 500 for missing regulations
lbeaufort added a commit to fecgov/fec-eregs that referenced this pull request May 15, 2018
- New version 8.4.2 now throws 404 errors instead of 500 errors for missing regulations (eregs/regulations-site#515)
- This will address fec-eregs #385: 404 instead of 500 for missing regulations
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants