Updates to allow bulk importing jats zip files.#89
Conversation
| to_notify = models.AutomatedImportNotification.objects.all() | ||
| request = Request() | ||
| press = pm.Press.objects.first() | ||
| request.press = press | ||
| request.site_type = press | ||
| request.repository = None | ||
|
|
||
| for n in to_notify: | ||
| n.send_notification( | ||
| [os.path.basename(z) for z in zip_files], | ||
| all_errors, | ||
| request, | ||
| ) |
There was a problem hiding this comment.
Notification behaviour should be behind a command line argument, as this might not be desireable in certain import scenarios (e.g. uploading back content from another platform)
| successes.append( | ||
| f'Imported {article}', | ||
| ) | ||
| call_command('register_crossref_doi', article[1].pk) |
There was a problem hiding this comment.
DOI registration behaviour should be behind a command line argument, as this might not be desireable in certain import scenarios (e.g. uploading back content from another platform)
| persist=persist, | ||
| ) | ||
|
|
||
| for article in articles: |
There was a problem hiding this comment.
DOIs can be registered in bulk for a given issue, which should reduce the load on Crossref end, as well as speed up the import procedure when each issue has multiple articles
There was a problem hiding this comment.
This looks to be quite a useful command, I added a few comments inline.
It is also probably worth deprecating the older command import_jats_zip to avoid code duplication. This command could either iterate a directory of zipped files or handle a single issue zip at the entrypoint.
|
@ajrbyers I just came across this in clearing out my notifications. I'm guessing it's new functionality needed for recent migrations, is that right? Should we add it to the 1.6 board? |
|
Oh is it related to #90? |
|
I’ve converted this to a draft for now. |
No description provided.