diff --git a/osf/models/mixins.py b/osf/models/mixins.py index f3063f1d91db..bd2ba523deda 100644 --- a/osf/models/mixins.py +++ b/osf/models/mixins.py @@ -2270,7 +2270,10 @@ def copy_editable_fields(self, resource, auth=None, alternative_resource=None, i but the alternative_resource will be a Node. DraftRegistration fields will trump Node fields. TODO, add optional logging parameter """ - self.set_editable_attribute('title', resource, alternative_resource) + from osf.models.draft_node import DraftNode + if not isinstance(resource, DraftNode): # Force the user to add there own title. + self.set_editable_attribute('title', resource, alternative_resource) + self.set_editable_attribute('description', resource, alternative_resource) self.set_editable_attribute('category', resource, alternative_resource) self.set_editable_attribute('node_license', resource, alternative_resource) diff --git a/osf/models/registrations.py b/osf/models/registrations.py index cd225c49b4a7..26b2ca09e887 100644 --- a/osf/models/registrations.py +++ b/osf/models/registrations.py @@ -1263,7 +1263,7 @@ def create_from_node(cls, user, schema, node=None, data=None, provider=None): if not node: # If no node provided, a DraftNode is created for you - node = DraftNode.objects.create(creator=user, title='Untitled') + node = DraftNode.objects.create(creator=user, title=settings.DEFAULT_DRAFT_NODE_TITLE) if not (isinstance(node, Node) or isinstance(node, DraftNode)): raise DraftRegistrationStateError() diff --git a/website/settings/defaults.py b/website/settings/defaults.py index 1438e90e07bb..dac43d2ecae7 100644 --- a/website/settings/defaults.py +++ b/website/settings/defaults.py @@ -2129,3 +2129,4 @@ def from_node_usage(cls, usage_bytes, private_limit=None, public_limit=None): PREPRINT_METRICS_START_DATE = datetime.datetime(2019, 1, 1) WAFFLE_VALUES_YAML = 'osf/features.yaml' +DEFAULT_DRAFT_NODE_TITLE = 'Untitled' \ No newline at end of file