merixstudio / django-trench

django-trench provides a set of REST API endpoints to supplement django-rest-framework with multi-factor authentication (MFA, 2FA). It supports both standard built-in authentication methods, as well as JWT (JSON Web Token).
Other
274 stars 57 forks source link

Unordered MFAMethod causing pagination warning during tests #195

Open smurphles opened 1 year ago

smurphles commented 1 year ago

Describe the bug Warning when running tests due to no list ordering.

To Reproduce Steps to reproduce the behavior:

  1. Hitting this endpoint in tests: /mfa/user-active-methods/
  2. Yields this error: django.core.paginator.UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class 'authorization.models.MFAMethod'> QuerySet.

Expected behavior The endpoint should have an ordering - or the model should have default ordering.

smurphles commented 1 year ago

PR: https://github.com/merixstudio/django-trench/pull/196