Skip to content

Commit 265cca4

Browse files
author
Benjamin Bardin
committed
dont count on filter exception having a message
1 parent 5b9842a commit 265cca4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dynamic_rest/filters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,8 @@ def _filter_queryset(
530530
except Exception as e:
531531
# Some other Django error in parsing the filter. Very likely
532532
# a bad query, so throw a ValidationError.
533-
raise ValidationError(e.message)
533+
err_msg = getattr(e, 'message', '')
534+
raise ValidationError(err_msg)
534535

535536
# A serializer can have this optional function
536537
# to dynamically apply additional filters on

0 commit comments

Comments
 (0)