Skip to content
Snippets Groups Projects

Return original expression for non-matching regex in find_field_with_sort_order

Merged oury.balde requested to merge topic/16.0/oury into branch/16.0
4 files
+ 8
2
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 1
1
@@ -29,7 +29,7 @@ def find_field_with_sort_order(expression):
Returns field name and value if found, else `(None, None)`.
"""
match = re.match(r'(\w+)\.sorted\("([^"]+)"\)', expression)
return match.groups() if match else (None, None)
return match.groups() if match else (expression, None)
def parse_fields_with_sort_directions(input_string):
Loading