aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-09-24 22:50:40 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-09-24 22:50:44 -0700
commit747281b45ddc35312c6978e0a38a3145abc8883a (patch)
tree6dda337fb4e9b5b05d00aa450b083f8d9f42750a /python
parent979d21ff54273ff3942e34d244e585287a1d6c79 (diff)
downloadfatcat-747281b45ddc35312c6978e0a38a3145abc8883a.tar.gz
fatcat-747281b45ddc35312c6978e0a38a3145abc8883a.zip
if we need to create a container for a release, accept it
This is working around bad (and undocumented) behavior around autoaccept batch imports, which resulted in hundreds of thousands of duplicate "unaccepted" containers in production.
Diffstat (limited to 'python')
-rw-r--r--python/fatcat/crossref_importer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/fatcat/crossref_importer.py b/python/fatcat/crossref_importer.py
index c3e8f9db..8e179b69 100644
--- a/python/fatcat/crossref_importer.py
+++ b/python/fatcat/crossref_importer.py
@@ -250,7 +250,10 @@ class FatcatCrossrefImporter(FatcatImporter):
if entities is not None:
(re, ce) = entities
if ce is not None:
- container = self.api.create_container(ce, editgroup=editgroup)
+ ce_eg = self.api.create_editgroup(
+ fatcat_client.Editgroup(editor_id='aaaaaaaaaaaabkvkaaaaaaaaae'))
+ container = self.api.create_container(ce, editgroup=ce_eg.id)
+ self.api.accept_editgroup(ce_eg.id)
re.container_id = container.ident
self._issnl_id_map[ce.issnl] = container.ident
release_batch.append(re)