diff --git a/users/admin.py b/users/admin.py index c5f11c4..23755e2 100644 --- a/users/admin.py +++ b/users/admin.py @@ -1,14 +1,14 @@ from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin -from .models import Key, Profile, Site, User +from .models import PgpKey, Profile, Site, User class SiteAdmin(admin.ModelAdmin): list_display = ('name', 'icon', 'domain', 'url_template') -class KeyInline(admin.TabularInline): - model = Key +class PgpKeyInline(admin.TabularInline): + model = PgpKey extra = 1 @@ -22,7 +22,7 @@ class UserAdmin(BaseUserAdmin): ('Profile', {'fields': ('avatar', 'xmpp', 'note')}), ) inlines = ( - KeyInline, + PgpKeyInline, ProfileInline, ) diff --git a/users/migrations/0017_rename_key_pgpkey.py b/users/migrations/0017_rename_key_pgpkey.py new file mode 100644 index 0000000..9d12dc6 --- /dev/null +++ b/users/migrations/0017_rename_key_pgpkey.py @@ -0,0 +1,17 @@ +# Generated by Django 3.2.20 on 2023-08-10 06:37 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('users', '0016_alter_user_first_name'), + ] + + operations = [ + migrations.RenameModel( + old_name='Key', + new_name='PgpKey', + ), + ] diff --git a/users/models.py b/users/models.py index f8bfdee..274b82c 100644 --- a/users/models.py +++ b/users/models.py @@ -197,7 +197,7 @@ class Profile(models.Model): ordering = ('site', 'username') -class Key(models.Model): +class PgpKey(models.Model): """ Represents a PGP key that belongs to a particular :model:`users.User`. Each key will be added to the user's h-card with rel="pgpkey", a format