Skip to content

Commit

Permalink
Fix problem with non numeric values
Browse files Browse the repository at this point in the history
  • Loading branch information
ffont committed Apr 17, 2024
1 parent 47dbbbc commit ff08302
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion utils/search/search_query_processor_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ def __init__(self, query_param_min=None, query_param_max=None, **kwargs):
self.query_param_min = query_param_min
self.query_param_max = query_param_max
super().__init__(**kwargs)


def get_value_from_request(self):
if self.query_param_min is not None and self.query_param_max is not None:
Expand All @@ -333,10 +332,16 @@ def get_value_from_request(self):
if self.query_param_min in self.request.GET:
value_from_param = str(self.request.GET[self.query_param_min])
if value_from_param:
if value_from_param != '*':
# A common user mistake is to write the number next to the * character, so we remove if it is not the only character
value_from_param = value_from_param.replace('*', '')
value[0] = value_from_param
if self.query_param_max in self.request.GET:
value_from_param = str(self.request.GET[self.query_param_max])
if value_from_param:
if value_from_param != '*':
# A common user mistake is to write the number next to the * character, so we remove if it is not the only character
value_from_param = value_from_param.replace('*', '')
value[1] = value_from_param
return value

Expand Down

0 comments on commit ff08302

Please sign in to comment.