Skip to content

Commit

Permalink
Merge pull request #142 from patrickpasquini/master
Browse files Browse the repository at this point in the history
πŸ› Fix nested attr bug db_field_info: getattr -> eval
  • Loading branch information
mauro-andre authored Jul 18, 2024
2 parents 11b50ce + bf9bb82 commit 5363040
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyodmongo/queries/query_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def mount_query_filter(
value[index] = js_regex_to_python(item)
if type(value) != LogicalOperator:
try:
db_field_info: DbField = getattr(Model, field_name)
db_field_info: DbField = eval(f"Model.{field_name}")
except AttributeError:
raise AttributeError(
f"There's no field '{field_name}' in {Model.__name__}"
Expand Down

0 comments on commit 5363040

Please sign in to comment.