Skip to content

Commit

Permalink
Merge pull request #52 from Aristotle-Metadata-Enterprises/fixRaise
Browse files Browse the repository at this point in the history
Fixes raise exception during error handling code
  • Loading branch information
s-i-l-k-e authored Jan 10, 2024
2 parents 3cde94c + 28eb2ae commit fd57add
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions data_interrogator/interrogators.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def is_translatable(self, column) -> bool:
"""Return whether a forbidden field exists in the query"""
if not GARNETT_ENABLED:
return False

checking_model = self.base_model

joins = list(enumerate(column.split('__')))
Expand Down Expand Up @@ -502,14 +502,13 @@ def interrogate(self, base_model, columns=None, filters=None, order_by=None, lim
errors.append("The requested field '%s' was not found in the database." % field)
else:
errors.append("An error was found with your query:\n%s" % e)
raise e
except Exception as e:
rows = []
errors.append("Something went wrong - %s" % e)

return {
'rows': rows, 'count': count, 'columns': output_columns, 'errors': errors,
'base_model': base_model_data,
'base_model': base_model_data,
# 'query': query # DEBUG Tool
}

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-data-interrogator"
version = "0.3.3"
version = "0.3.4"
description = "A suite of interactive table builder utilities that create reports using efficient SQL queries"
authors = ["Aristotle Metadata Enterprises"]
license = "BSD-3-Clause"
Expand Down

0 comments on commit fd57add

Please sign in to comment.