From f4e428a893a989141fe71afa1585f703be6f3de0 Mon Sep 17 00:00:00 2001 From: Alzpetka Date: Fri, 6 Sep 2024 12:29:27 +0200 Subject: [PATCH] refactor --- oarepo_doi/types/doi.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/oarepo_doi/types/doi.py b/oarepo_doi/types/doi.py index 1e0de63..4658beb 100644 --- a/oarepo_doi/types/doi.py +++ b/oarepo_doi/types/doi.py @@ -5,13 +5,16 @@ class AssignDoiRequestType(NonDuplicableOARepoRequestType): type_id = "assign_doi" - name = _("assign_doi") + name = _("Assign Doi") - available_actions = { - **super().available_actions, - "accept": CreateDoiAction, - "submit": ValidateDataForDoiAction, - } + @classmethod + @property + def available_actions(cls): + return { + **super().available_actions, + "accept": CreateDoiAction, + "submit": ValidateDataForDoiAction, + } - receiver_can_be_none = False + receiver_can_be_none = True allowed_topic_ref_types = ModelRefTypes(published=True, draft=True)