Skip to content

Add a better error message when a Func is missing as_mql() #281

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

Merged
merged 1 commit into from
Apr 8, 2025

Conversation

timgraham
Copy link
Collaborator

I have seen this too many times:

  File "/home/tim/code/django-mongodb/django_mongodb_backend/functions.py", line 105, in func
    operator = MONGO_OPERATORS.get(self.__class__, self.function.lower())
                                                   ^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'lower'

@timgraham timgraham force-pushed the func-error-message branch from 017a567 to 4de9516 Compare April 6, 2025 01:14
@timgraham timgraham merged commit 4de9516 into mongodb:main Apr 8, 2025
14 checks passed
@timgraham timgraham deleted the func-error-message branch April 8, 2025 00:16
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

Successfully merging this pull request may close these issues.

2 participants