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

Fix elections endpoint to handle per_page=0 #3303

Merged
merged 1 commit into from
Jul 24, 2018

Conversation

fec-jli
Copy link
Contributor

@fec-jli fec-jli commented Jul 24, 2018

Summary:
when fec-cms pass per_page=0 (means: get all results, don't do pagination),
the elections endpoint not handle this case,
so set cap=0 to avoid doing pagination.

related PR: #3292

How to test locally:

  1. checkout branch : feature/fix_elections_per_page
    2)DB--dev
    3)loach cms point to local api
    4)test elections summary pages to make sure all data sets result correctly.

@fec-jli fec-jli self-assigned this Jul 24, 2018
@fec-jli fec-jli requested a review from lbeaufort July 24, 2018 19:01
@@ -128,6 +129,19 @@ def args(self):
),
)

def get(self, *args, **kwargs):
query = self.build_query(*args, **kwargs)
count = counts.count_estimate(query, models.db.session, threshold=500000)
Copy link
Contributor

@pkfec pkfec Jul 24, 2018

Choose a reason for hiding this comment

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

Any reason why the threshold is set to high value?

Copy link
Member

@lbeaufort lbeaufort left a comment

Choose a reason for hiding this comment

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

Looks good. I'm having some issues with S3 credentials but I don't want to hold up the changes.

@lbeaufort lbeaufort merged commit 01286cb into develop Jul 24, 2018
@fec-jli fec-jli deleted the feature/fix_elections_per_page branch August 23, 2018 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants