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

I18N_JSONFields can't be queried against boolean values #11802

Open
jacobtylerwalls opened this issue Feb 20, 2025 · 0 comments
Open

I18N_JSONFields can't be queried against boolean values #11802

jacobtylerwalls opened this issue Feb 20, 2025 · 0 comments
Labels
Type: Bug Something isn't working

Comments

@jacobtylerwalls
Copy link
Member

jacobtylerwalls commented Feb 20, 2025

Querying against a key-value pair of an I18N_JSONField for a boolean value fails when it hits our guard against silent data loss.

We should look into letting I18n_JSON._parse() handle booleans.

In [1]: from arches.app.models.models import *

In [2]: Node.objects.filter(cardxnodexwidget__config__uneditable=True)
---------------------------------------------------------------------------
File ~/prj/arches/arches/app/models/fields/i18n.py:270, in I18n_JSON._parse(self, value, lang, use_nulls)
    268     ret = value
    269 else:
--> 270     raise TypeError(value)
    271 self.raw_value = ret
    273 if "i18n_properties" in self.raw_value:

TypeError: True
@jacobtylerwalls jacobtylerwalls added the Type: Bug Something isn't working label Feb 20, 2025
@chiatt chiatt added this to pipeline Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

1 participant