forked from 00dani/lemoncurry
Rename Key to PgpKey, so other keys can fit too
This commit is contained in:
parent
fe187da491
commit
cd990e4e2f
3 changed files with 22 additions and 5 deletions
|
@ -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,
|
||||
)
|
||||
|
||||
|
|
17
users/migrations/0017_rename_key_pgpkey.py
Normal file
17
users/migrations/0017_rename_key_pgpkey.py
Normal 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',
|
||||
),
|
||||
]
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue