Skip to content

Commit

Permalink
Merge pull request #72 from oarepo/krist/editable-field-default-value
Browse files Browse the repository at this point in the history
editable is false for publish draft request type
  • Loading branch information
mesemus authored Oct 18, 2024
2 parents 2a6f73d + ff159e1 commit d0d0971
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions oarepo_requests/types/publish_draft.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def available_actions(cls):
receiver_can_be_none = True
allowed_topic_ref_types = ModelRefTypes(published=True, draft=True)

editable = False

def can_create(self, identity, data, receiver, topic, creator, *args, **kwargs):
if not topic.is_draft:
raise ValueError("Trying to create publish request on published record")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def test_ui_serialization(
"name": "Publish draft",
"type_id": "publish_draft",
"dangerous": False,
"editable": True,
"editable": False,
"has_form": True,
"stateful_description": "By submitting the draft for review you are "
"requesting the publication of the draft. The draft "
Expand Down

0 comments on commit d0d0971

Please sign in to comment.