Skip to content

Commit

Permalink
openlibhums#2817: Add a setting for auto-registering issue dois
Browse files Browse the repository at this point in the history
  • Loading branch information
mauromsl committed Sep 8, 2022
1 parent 9749a76 commit f0c00a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def get_settings_to_edit(display_group, journal):
xref_settings = [
'use_crossref', 'crossref_test', 'crossref_username', 'crossref_password', 'crossref_email',
'crossref_name', 'crossref_prefix', 'crossref_registrant', 'doi_display_prefix', 'doi_display_suffix',
'doi_pattern', 'doi_manager_action_maximum_size',
'doi_pattern', 'doi_manager_action_maximum_size', 'title_doi', 'issue_doi_pattern', 'register_issue_dois'
]

settings = process_setting_list(xref_settings, 'Identifiers', journal)
Expand Down
6 changes: 5 additions & 1 deletion src/events/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ class Events:
# raised when proofing is complete
ON_PROOFING_COMPLETE = 'on_proofing_complete'

#kwargs: request, article
# kwargs: article, issue, user
# raised when an article is assigned to an issue
ON_ARTICLE_ASSIGNED_TO_ISSUE = 'on_article_assigned_to_issue'

# kwargs: request, article
# raised when an article is marked as published
ON_ARTICLE_PUBLISHED = 'on_article_published'

Expand Down
6 changes: 6 additions & 0 deletions src/events/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from utils import transactional_emails, workflow_tasks
from events import logic as event_logic
from journal import logic as journal_logic
from identifiers import logic as id_logic

# wire up event notifications

Expand Down Expand Up @@ -181,3 +182,8 @@
# N.B. this is critical to the operation of the task framework. It automatically tears down tasks that have registered
# for event listeners
event_logic.Events.register_for_event('destroy_tasks', core_models.Task.destroyer)

event_logic.Events.register_for_event(
event_logic.Events.ON_ARTICLE_ASSIGNED_TO_ISSUE,
id_logic.on_article_assign_to_issue,
)

0 comments on commit f0c00a9

Please # to comment.