Skip to content

Commit

Permalink
Add event on submission start
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Aug 30, 2024
1 parent 14ec665 commit e8b4946
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/events/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class Events:

# list of event constants used internally by Janeway

# kwargs: article, request
# raised when an article submission has started
ON_ARTICLE_SUBMISSION_START = 'on_article_submission_start'

# kwargs: article, request
# raised when an article is submitted
ON_ARTICLE_SUBMITTED = 'on_article_submitted'
Expand Down
8 changes: 8 additions & 0 deletions src/submission/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ def start(request, type=None):
).processed_value:
logic.add_user_as_author(request.user, new_article)

event_logic.Events.raise_event(
event_logic.Events.ON_ARTICLE_SUBMISSION_START,
**{'handshake_url': 'submission_start',
'request': request,
'article': article,
'switch_stage': False}
)

return redirect(reverse('submit_info', kwargs={'article_id': new_article.pk}))

template = 'admin/submission/start.html'
Expand Down

0 comments on commit e8b4946

Please sign in to comment.