Project

General

Profile

Bug #80915

api: erreur lors du parcours de la liste des utilisateurs dans l'ordre inverse

Added by Sentry Io about 1 year ago. Updated about 1 month ago.

Status:
Solution déployée
Priority:
Normal
Category:
-
Target version:
-
Start date:
05 September 2023
Due date:
% Done:

0%

Estimated time:
Patch proposed:
No
Planning:
No

Description

https://sentry.entrouvert.org/entrouvert/publik/issues/113188/

AttributeError: 'Unaccent' object has no attribute 'startswith'
(11 additional frame(s) were not displayed)
...
  File "rest_framework/generics.py", line 171, in paginate_queryset
    return self.paginator.paginate_queryset(queryset, self.request, view=self)
  File "rest_framework/pagination.py", line 618, in paginate_queryset
    queryset = queryset.order_by(*_reverse_ordering(self.ordering))
  File "rest_framework/pagination.py", line 123, in _reverse_ordering
    return tuple([invert(item) for item in ordering_tuple])
  File "rest_framework/pagination.py", line 123, in <listcomp>
    return tuple([invert(item) for item in ordering_tuple])
  File "rest_framework/pagination.py", line 121, in invert
    return x[1:] if x.startswith('-') else '-' + x

Associated revisions

Revision 5f5d6067 (diff)
Added by Benjamin Dauvergne about 1 month ago

api: only use strings in ordering tuples (#80915)

History

#1

Updated by Serghei Mihai about 1 year ago

  • Project changed from Suivi des traces to Authentic 2
#2

Updated by Benjamin Dauvergne 2 months ago

  • Assignee set to Benjamin Dauvergne
#3

Updated by Robot Gitea 2 months ago

  • Status changed from Nouveau to En cours

Benjamin Dauvergne (bdauvergne) a ouvert une pull request sur Gitea concernant cette demande :

#4

Updated by Benjamin Dauvergne 2 months ago

On utilise une fonction SQL comme ordre ordering=[..Unaccent('last_name')] qui est incompatible avec le fonctionnement de la pagination dans DRF.

#5

Updated by Robot Gitea 2 months ago

  • Status changed from En cours to Solution proposée
#6

Updated by Robot Gitea about 2 months ago

  • Status changed from Solution proposée to Solution validée

Serghei Mihai (smihai) a approuvé une pull request sur Gitea concernant cette demande :

#7

Updated by Robot Gitea about 1 month ago

  • Status changed from Solution validée to Résolu (à déployer)

Benjamin Dauvergne (bdauvergne) a mergé une pull request sur Gitea concernant cette demande :

#8

Updated by Transition automatique about 1 month ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF