Skip to content

Commit

Permalink
Merge pull request #1442 from BradleySappington/anomaly_bugfix
Browse files Browse the repository at this point in the history
bug fix for values_list
  • Loading branch information
BradleySappington authored Jan 24, 2024
2 parents 550e930 + a6a7a57 commit b242db2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion jwql/website/apps/jwql/data_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1593,7 +1593,10 @@ def get_rootnames_from_query(parameters):
else:
current_ins_rootfileinfos = current_ins_rootfileinfos.order_by('-root_name')

rootnames = [name[0] for name in current_ins_rootfileinfos.values_list('root_name')]
# Django is doing something wonky here. I can't call values_list with a single parameter, even with 'flat=True' as per Django Docs.
# TODO: This is hacky and should be fixed.
filtered_list = list(current_ins_rootfileinfos.values_list('root_name', 'expstart'))
rootnames = [name[0] for name in filtered_list]
filtered_rootnames.extend(rootnames)

return filtered_rootnames
Expand Down

0 comments on commit b242db2

Please sign in to comment.