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

concept dt validation not working on tile.save() if concept-list nodevalue mistakenly saved #11088

Open
whatisgalen opened this issue Jun 25, 2024 · 0 comments
Labels
bug Type: Bug Something isn't working

Comments

@whatisgalen
Copy link
Member

whatisgalen commented Jun 25, 2024

Discovered this while working on a test for #10789,

If you notice that in this setup logic in search tests,

tile = Tile(
            data={cls.search_model_cultural_period_nodeid: [valueid]},
            nodegroup_id=cls.search_model_cultural_period_nodeid,
        )
... 
tile.save()

the valueid is saved as a list even though the datatype for the node is 'concept', not 'concept-list'.

No errors or warnings are raised for this. It only gets caught on this line upstream of search_export:

File "/Users/galenmancino/repos/arches/arches/app/datatypes/concept_types.py", line 284, in get_display_value
    if data[str(node.nodeid)] is None or data[str(node.nodeid)].strip() == "":
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'strip'

...because the datatype of the nodevalue is at odds with the datatype of the node.

@whatisgalen whatisgalen added Type: Bug Something isn't working bug labels Jun 25, 2024
@whatisgalen whatisgalen changed the title concept dt validation not working on tile.save if concept-list nodevalue mistakenly saved concept dt validation not working on tile.save() if concept-list nodevalue mistakenly saved Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type: Bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant