Skip to content

Commit

Permalink
#145: Fix bug on non-count queries
Browse files Browse the repository at this point in the history
  • Loading branch information
MRichards99 committed Sep 30, 2020
1 parent 86c6f27 commit 692ac0f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/icat/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ def execute_query(self, client, return_json_formattable=False):

# If the query has a COUNT function applied to it, some of these steps can be
# skipped
count_query = True if "COUNT" in self.query.aggregate else False
count_query = False
if self.query.aggregate is not None:
if "COUNT" in self.query.aggregate:
count_query = True

if self.query.aggregate == "DISTINCT" and not count_query:
log.info("Extracting the distinct fields from query's conditions")
Expand Down

0 comments on commit 692ac0f

Please sign in to comment.