Closed omidraha closed 1 year ago
Hi @omidraha, thanks for pointing this out. Sort was listed as optional in the SCIM2.0 spec and thus not a major focus when developing this library.
Your fix does, at first glance, appear to fix the issue. I'd be more than happy to review a PR with this change if you are willing to issue it. Otherwise, I'll have to address this as my time allows.
Scratch that, I was able to address this now.
Describe the bug
The code sorts the results based on the
lookup_field
, and there is no way to sort the results based on any other field, especially themodified
field.To Reproduce Steps to reproduce the behavior...
Expected behavior We expect to be able to sort the results based on any field, especially the
modified
field.Stacktrace
Additional context
By swapping these two lines of code, the ordering of the queryset by
lookup_field
will be performed before applying any custom filtering or modifications viaget_queryset_post_processor()
,So the solution is to replace the following code:
with this code: