Skip to content

Commit

Permalink
Merge pull request #510 from pyinat/batch-ids
Browse files Browse the repository at this point in the history
Batch requests by ID that exceed max GET URL length
  • Loading branch information
JWCook authored Sep 19, 2023
2 parents b181947 + a9e5ca2 commit 886ae99
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion pyinaturalist/controllers/observation_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
upload,
)

# TODO: Just a guess; test maximum allowed IDs per request
IDS_PER_REQUEST = 30


Expand Down
2 changes: 1 addition & 1 deletion pyinaturalist/controllers/taxon_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def populate(self, taxon: Taxon, **params) -> Taxon:
full_taxon = self.from_ids(taxon.id, **params).one()
for key in set(fields_dict(Taxon).keys()) - preserve_keys:
# Use getters/setters for LazyProperty instead of temp attrs (cls.foo vs cls._foo)
if hasattr(key, key.lstrip('_')):
if hasattr(taxon, key.lstrip('_')):
key = key.lstrip('_')
setattr(taxon, key, getattr(full_taxon, key))
return taxon

0 comments on commit 886ae99

Please sign in to comment.