From 7414593d646108761b9a90749bee9a6acfe302b0 Mon Sep 17 00:00:00 2001 From: John Tordoff <> Date: Wed, 27 Sep 2023 00:22:55 +0800 Subject: [PATCH] fix excluded no project attributes for Draft Registration --- osf/models/registrations.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osf/models/registrations.py b/osf/models/registrations.py index ccbe78c62cd..ceff62c98a2 100644 --- a/osf/models/registrations.py +++ b/osf/models/registrations.py @@ -1261,9 +1261,12 @@ def create_from_node(cls, user, schema, node=None, data=None, provider=None): else: provider.validate_schema(schema) + excluded_attributes = [] if not node: # If no node provided, a DraftNode is created for you node = DraftNode.objects.create(creator=user, title=settings.DEFAULT_DRAFT_NODE_TITLE) + # Force the user to add their own title for no-project + excluded_attributes.append('title') if not (isinstance(node, Node) or isinstance(node, DraftNode)): raise DraftRegistrationStateError() @@ -1279,7 +1282,7 @@ def create_from_node(cls, user, schema, node=None, data=None, provider=None): draft.copy_editable_fields( node, save=True, - excluded_attributes=['title'] # Force the user to add their own title for no-project + excluded_attributes=excluded_attributes ) draft.update(data, auth=Auth(user))