Skip to content

Commit

Permalink
register action
Browse files Browse the repository at this point in the history
  • Loading branch information
Alzpeta committed Oct 2, 2024
1 parent 1e4438f commit 7c76883
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions oarepo_doi/actions/doi.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,25 @@ def execute(self, identity, uow, *args, **kwargs):

self.credentials(slug)

#todo - only public?
if topic.is_draft:
create_doi(self, topic, topic, None)
else:
create_doi(self, topic, topic, "publish")
super().execute(identity, uow)


class RegisterDoiAction(AssignDoiAction):

def execute(self, identity, uow, *args, **kwargs):
topic = self.request.topic.resolve()
slug = community_slug_for_credentials(topic.parent["communities"].get("default", None))

self.credentials(slug)

create_doi(self, topic, topic, None)

super().execute(identity, uow)
class ValidateDataForDoiAction(OARepoSubmitAction):
log_event = True

Expand Down

0 comments on commit 7c76883

Please sign in to comment.