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

Queries Are Always Case-Insensitive #88

Open
pasetti opened this issue Nov 17, 2022 · 0 comments
Open

Queries Are Always Case-Insensitive #88

pasetti opened this issue Nov 17, 2022 · 0 comments
Assignees

Comments

@pasetti
Copy link
Contributor

pasetti commented Nov 17, 2022

If I try to change the name or the domain of a spec_item by changing the case of one of its letters, I get an error. The error is triggered by this check:

        # Verify that, in edit mode, if the domain:name has been modified, it is unique within non-deleted, 
        # non-obsolete spec_items in the project and in the default ValSet
        if (self.mode == 'edit') and (('name' in self.changed_data) or ('domain' in self.changed_data)):
            if SpecItem.objects.exclude(status='DEL').exclude(status='OBS').filter(project_id=self.project.id, \
                         domain=cd['domain'], name=cd['name'], val_set_id=default_val_set_id).exists():
                raise forms.ValidationError('Edit Error: Domain:Name pair already exists in this project')

As far as I can tell, this means that the query is case-insensitive. However, as far as I can tell from the Django documentation, the query should be case-sensitive by default. Am I missing something?

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

No branches or pull requests

2 participants