Skip to content
This repository has been archived by the owner on Dec 23, 2017. It is now read-only.

Generate correct history parameter when next cycle is not available. #207

Merged
merged 3 commits into from
May 28, 2015

Conversation

jmcarp
Copy link
Contributor

@jmcarp jmcarp commented May 27, 2015

We use the next_cycle filter to generate the history query parameter
for the candidate detail page. The filter is meant to get the next
active cycle greater or equal to the specified cycle. This patch handles
the edge case in which no such cycle is found, in which case we should
simply use the latest active cycle. This fixes some errors on Jeff
Flake's candidate page.

We use the `next_cycle` filter to generate the `history` query parameter
for the candidate detail page. The filter is meant to get the next
active cycle greater or equal to the specified cycle. This patch handles
the edge case in which no such cycle is found, in which case we should
simply use the latest active cycle. This fixes some errors on Jeff
Flake's candidate page.
@LindsayYoung
Copy link
Contributor

👍

@LindsayYoung
Copy link
Contributor

Now 2017-2018 is showing up in the election cycle picker, can we add a filter for that in this function too?

http://localhost:3000/candidate/S2AZ00141?cycle=2012

@jmcarp
Copy link
Contributor Author

jmcarp commented May 28, 2015

@LindsayYoung the 2017-2018 cycle shouldn't be showing up anymore with this patch. At least I don't see it anymore. Let me know if you're still seeing this.

@LindsayYoung
Copy link
Contributor

LGTM will merge when tests pass

LindsayYoung added a commit that referenced this pull request May 28, 2015
Generate correct history parameter when next cycle is not available.
@LindsayYoung LindsayYoung merged commit 3e22dba into fecgov:develop May 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants