diff --git a/oarepo_doi/actions/doi.py b/oarepo_doi/actions/doi.py index 9da14f5..11d3421 100644 --- a/oarepo_doi/actions/doi.py +++ b/oarepo_doi/actions/doi.py @@ -47,6 +47,7 @@ def execute(self, identity, uow, *args, **kwargs): self.credentials(slug) + #todo - only public? if topic.is_draft: create_doi(self, topic, topic, None) else: @@ -54,6 +55,17 @@ def execute(self, identity, uow, *args, **kwargs): 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