Add default Token ordering behavior

This commit is contained in:
Jason Novinger 2025-07-23 12:32:12 -05:00
parent 6966c7ac23
commit 8e39481c6b
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,17 @@
# Generated by Django 5.2.4 on 2025-07-23 17:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('users', '0009_update_group_perms'),
]
operations = [
migrations.AlterModelOptions(
name='token',
options={'ordering': ('-created',)},
),
]

View File

@ -74,6 +74,7 @@ class Token(models.Model):
class Meta:
verbose_name = _('token')
verbose_name_plural = _('tokens')
ordering = ('-created',)
def __str__(self):
return self.key if settings.ALLOW_TOKEN_RETRIEVAL else self.partial