Skip to content
Snippets Groups Projects

Add customizable ordering and new request type for timeslot queryset

Merged Richard Blechinger requested to merge ordering-timeslots into master
All threads resolved!
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 1
1
@@ -541,7 +541,7 @@ class APITimeSlotViewSet(viewsets.ModelViewSet):
# If someone tries to sort by a field that isn't available on the model
# we silently ignore that and use the default sort order.
model_fields = [field.name for field in TimeSlot._meta.get_fields()]
if order not in model_fields:
if order.lstrip('-') not in model_fields:
order = default_order
Loading