Skip to content

Commit 6bf803f

Browse files
committed
Fix class name in error message when Func is missing as_mql()
1 parent 9b78e9e commit 6bf803f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

django_mongodb_backend/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def extract(self, compiler, connection):
109109
def func(self, compiler, connection):
110110
lhs_mql = process_lhs(self, compiler, connection, as_expr=True)
111111
if self.function is None:
112-
raise NotSupportedError(f"{self} may need an as_mql() method.")
112+
raise NotSupportedError(f"{self.__class__.__name__} may need an as_mql() method.")
113113
operator = MONGO_OPERATORS.get(self.__class__, self.function.lower())
114114
return {f"${operator}": lhs_mql}
115115

tests/db_functions_/tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
class FuncTests(SimpleTestCase):
77
def test_no_as_mql(self):
8-
msg = "Func() may need an as_mql() method."
8+
msg = "Func may need an as_mql() method."
99
with self.assertRaisesMessage(NotSupportedError, msg):
1010
Func().as_mql(None, None)

0 commit comments

Comments
 (0)