diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2019-12-13 17:43:27 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2019-12-13 18:07:53 -0800 |
commit | 9c1fd7cb8e60c397fa6defef2f0dc1eacc8d8aa7 (patch) | |
tree | c6d3f80610af009ebba799951bfe3a5c56e72694 /python/fatcat_tools/importers | |
parent | 4b2fc499ac77f4b929943b54a4c28b78659468e8 (diff) | |
download | fatcat-9c1fd7cb8e60c397fa6defef2f0dc1eacc8d8aa7.tar.gz fatcat-9c1fd7cb8e60c397fa6defef2f0dc1eacc8d8aa7.zip |
update ingest request schema
This is mostly changing ingest_type from 'file' to 'pdf', and adding
'link_source'/'link_source_id', plus some small cleanups.
Diffstat (limited to 'python/fatcat_tools/importers')
-rw-r--r-- | python/fatcat_tools/importers/ingest.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/python/fatcat_tools/importers/ingest.py b/python/fatcat_tools/importers/ingest.py index a4258a38..bd5713c3 100644 --- a/python/fatcat_tools/importers/ingest.py +++ b/python/fatcat_tools/importers/ingest.py @@ -132,10 +132,15 @@ class IngestFileResultImporter(EntityImporter): ) if fatcat and fatcat.get('edit_extra'): fe.edit_extra = fatcat['edit_extra'] + else: + fe.edit_extra = dict() if request.get('ingest_request_source'): - if not fe.edit_extra: - fe.edit_extra = dict() fe.edit_extra['ingest_request_source'] = request['ingest_request_source'] + if request.get('link_source') and request.get('link_source_id'): + fe.edit_extra['link_source'] = request['link_source'] + fe.edit_extra['link_source_id'] = request['link_source_id'] + if not fe.edit_extra: + fe.edit_extra = None return fe def try_update(self, fe): |