Skip to content
This repository was archived by the owner on Dec 16, 2025. It is now read-only.

Commit cfbad8b

Browse files
committed
bug fixes
1 parent d577550 commit cfbad8b

File tree

1 file changed

+4
-2
lines changed
  • flask_rest_jsonapi/data_layers/filtering

1 file changed

+4
-2
lines changed

flask_rest_jsonapi/data_layers/filtering/alchemy.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ def value(self):
119119
"""
120120
if self.filter_.get('field') is not None:
121121
try:
122-
return getattr(self.model, self.filter_['field'])
122+
result = getattr(self.model, self.filter_['field'])
123123
except AttributeError:
124-
raise InvalidFilters("{} has no attribute {}".format(self.model.__name__, self.field))
124+
raise InvalidFilters("{} has no attribute {}".format(self.model.__name__, self.filter_['field']))
125+
else:
126+
return result
125127
else:
126128
if 'val' not in self.filter_:
127129
raise InvalidFilters("Can't find value or field in a filter")

0 commit comments

Comments
 (0)