-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates to allow bulk importing jats zip files. #89
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.