Fec-cms: Limit individual contributor zip search to 5 digits

Created on 26 Oct 2017  ·  5Comments  ·  Source: fecgov/fec-cms

So that users can retrieve accurate contributor data based off zipcode, only the first 5 digits should be matched on the Individual Contributor Search. Currently, searching 5-digit zip excludes contributors with 9-digit zips, and searching 9-digit zips only returns data where the filer has provided the zip+4.

Email from data user:
_"I’m trying to do a search by zip code and would like it to match both 5 and 9 digit entries.

For example:
• If I pass in the contributor name of “frank” and “10050” for– I get 9 records back link
• However, if I add the zip code of 110502814 – I get an extra record for a total of 10 link

In this example, all that I have on my end is the 11050 zip code and I would like to use that information to get back all 10 records."_

Two proposed changes:
CMS
The zip code on this page should be limited to 5 characters

API
The zip search should match on the left(5) of the zip.

Thanks to Jason in Public Records for bringing this to my attention.

  • [x] limit front-end input to 5 digits
Bug

All 5 comments

What's the status of this issue?

@PaulClark2 Put this back on my plate to do for 5.2 since this got missed the previous time. @lbeaufort Is working on an API fix and I will add a front-end fix to not allow zip codes greater than 5 digits.

This issue is done for the front-end, however, still waiting on https://github.com/fecgov/openFEC/pull/3003 back-end PR to be implemented in order to merge this PR on the front-end

Is this ready to merge?

@AmyKort thanks to @hcaofec and @patphongs this issue is complete!

Was this page helpful?
0 / 5 - 0 ratings