Rename Key to PgpKey, so other keys can fit too

This commit is contained in:
Danielle McLean 2023-08-10 16:50:35 +10:00
parent fe187da491
commit cd990e4e2f
Signed by: 00dani
GPG key ID: 52C059C3B22A753E
3 changed files with 22 additions and 5 deletions

View file

@ -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,
)

View file

@ -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',
),
]

View file

@ -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