Skip to content

Commit 8fd24f6

Browse files
committed
add DatabaseError wrapping for aggregate() queries
1 parent e28f598 commit 8fd24f6

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

django_mongodb/features.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
100100
"ordering.tests.OrderingTests.test_order_by_grandparent_fk_with_expression_in_default_ordering",
101101
"ordering.tests.OrderingTests.test_order_by_parent_fk_with_expression_in_default_ordering",
102102
"ordering.tests.OrderingTests.test_order_by_ptr_field_with_default_ordering_by_expression",
103-
# pymongo.errors.OperationFailure: $multiply only supports numeric
104-
# types, not date. (should be wrapped in DatabaseError).
105-
"expressions.tests.FTimeDeltaTests.test_invalid_operator",
106103
# alias().order_by() doesn't work.
107104
"annotations.tests.AliasTests.test_order_by_alias",
108105
# annotate() + values_list() + order_by() loses annotated value.

django_mongodb/query.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def delete(self):
9191
options = self.connection.operation_flags.get("delete", {})
9292
return self.collection.delete_many(self.mongo_query, **options).deleted_count
9393

94+
@wrap_database_errors
9495
def get_cursor(self):
9596
if self.query.low_mark == self.query.high_mark:
9697
return []

0 commit comments

Comments
 (0)