Skip to content
Snippets Groups Projects
Commit 758bb25a authored by Richard Blechinger's avatar Richard Blechinger
Browse files

Strip - character to make sure field can be validated properly

parent be1c271e
No related branches found
No related tags found
1 merge request!15Add customizable ordering and new request type for timeslot queryset
This commit is part of merge request !15. Comments created here will be created in the context of that merge request.
...@@ -541,7 +541,7 @@ class APITimeSlotViewSet(viewsets.ModelViewSet): ...@@ -541,7 +541,7 @@ class APITimeSlotViewSet(viewsets.ModelViewSet):
# If someone tries to sort by a field that isn't available on the model # 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. # we silently ignore that and use the default sort order.
model_fields = [field.name for field in TimeSlot._meta.get_fields()] 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 order = default_order
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment