Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource.copy() does not work #10712

Open
jacobtylerwalls opened this issue Mar 25, 2024 · 1 comment
Open

Resource.copy() does not work #10712

jacobtylerwalls opened this issue Mar 25, 2024 · 1 comment

Comments

@jacobtylerwalls
Copy link
Member

Not urgent as the button is disabled since #8445, but should be solved with #8352

>>> ri
>>> ri = ResourceInstance(pk='af792d07-e8a7-4f60-929e-591d2dfc4579')
>>> ri.refresh_from_db()
>>> ri.graph
<GraphModel: Instrument>
>>> r = Resource(ri.pk)
>>> r.graph = ri.graph
>>> r.copy()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/web_root/arches/arches/app/models/resource.py", line 752, in copy
    new_resource.save(context="copy")
  File "/web_root/arches/arches/app/models/resource.py", line 249, in save
    self.index(context)
  File "/web_root/arches/arches/app/models/resource.py", line 337, in index
    document, terms = self.get_documents_to_index(datatype_factory=datatype_factory, node_datatypes=node_datatypes, context=context)
  File "/web_root/arches/arches/app/models/resource.py", line 383, in get_documents_to_index
    context["language"] = lang[0]
TypeError: 'str' object does not support item assignment
@jacobtylerwalls
Copy link
Member Author

In 8.0, this method will also need to be updated to no longer set nodegroup =.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant