Skip to content

Commit

Permalink
Fix htcli no working without ordering parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
rixvet committed Aug 21, 2023
1 parent e428fbf commit a12dd2f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ci/apiv2/htcli.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,16 @@ def get_opt_list(options):
# Parse options and arguments
expand = get_opt_list(opt_expand)
filter = dict([filter_item.split('=', 1) for filter_item in get_opt_list(opt_filter) if filter_item])
ordering = get_opt_list(opt_ordering)
display_field_filter = get_opt_list(opt_fields)

if opt_ordering:
filter['ordering'] = get_opt_list(opt_ordering)

# Retrieve objects
if not opt_filter:
objs = model_class.objects.all(expand, ordering)
objs = model_class.objects.all(expand)
else:
objs = model_class.objects.filter(expand, ordering, **filter)
objs = model_class.objects.filter(expand, **filter)

# Display objects
if is_brief is True:
Expand Down

0 comments on commit a12dd2f

Please sign in to comment.