Skip to content

Commit ab61c52

Browse files
committed
add DatabaseError wrapping for aggregate() queries
1 parent 4f52df0 commit ab61c52

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
@@ -102,9 +102,6 @@ class DatabaseFeatures(BaseDatabaseFeatures):
102102
# 'Col' object has no attribute 'utcoffset'
103103
"expressions.tests.IterableLookupInnerExpressionsTests.test_expressions_in_lookups_join_choice",
104104
"expressions.tests.IterableLookupInnerExpressionsTests.test_in_lookup_allows_F_expressions_and_expressions_for_datetimes",
105-
# pymongo.errors.OperationFailure: $multiply only supports numeric
106-
# types, not date. (should be wrapped in DatabaseError).
107-
"expressions.tests.FTimeDeltaTests.test_invalid_operator",
108105
# alias().order_by() doesn't work.
109106
"annotations.tests.AliasTests.test_order_by_alias",
110107
# 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)