Skip to content

Commit

Permalink
Merge pull request #15741 from ahmedhamidawan/related_filter_validate…
Browse files Browse the repository at this point in the history
…_integer

[23.0] Validate history Related filter in backend
  • Loading branch information
davelopez committed Mar 9, 2023
2 parents 5a34325 + 832e6f2 commit ef2678b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/galaxy/managers/history_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,16 @@ def parse_query_filters_with_relations(self, query_filters: ValueFilterQueryPara
qv_index = query_filters.q.index("related-eq")
qv_hid = query_filters.qv[qv_index]

# Type check whether hid is int
if not qv_hid.isdigit():
raise glx_exceptions.RequestParameterInvalidException(
"unparsable value for filter",
column="related",
operation="eq",
value=qv_hid,
ValueError="invalid type in filter",
)

# Make new q and qv excluding related filter
new_q = [x for i, x in enumerate(query_filters.q) if i != qv_index]
new_qv = [x for i, x in enumerate(query_filters.qv) if i != qv_index]
Expand Down

0 comments on commit ef2678b

Please sign in to comment.