history-lab / foiarchive-api

REST API for Freedom of Information Archive (FOIArchive)
3 stars 0 forks source link

controller.py -- populate_docs_entities #1

Open arpie71 opened 6 years ago

arpie71 commented 6 years ago

The function calls for an SQL query for countries, persons, and topics. Retrieving all (country_list = q.all(), for example) breaks the function. If this is changed to a limit, the function works.

mnyrop commented 6 years ago

Is this fixed? If so, can you link to specific line numbers and I'll commit the changes with context?

arpie71 commented 6 years ago

It's fixed on my branch. The line numbers in your controller.py file are 212, 227, and 241.

mnyrop commented 6 years ago

What if the API query has more than 1000 results? Isn't the limit arbitrary/inaccurate?

arpie71 commented 6 years ago

That's a fair point, but right now the populate_docs_entities only calls the topics, persons, and countries databases. Topics and countries have fewer than 1000 entries and persons does now as well.