diff options
author | Dan McGee <dan@archlinux.org> | 2012-04-20 10:21:28 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-04-20 11:15:03 -0500 |
commit | d21d8be0186413fe1fa5fd6c859786465472ee10 (patch) | |
tree | 2309796163078af30b05f340dbe0e816a92f6a84 /devel/admin.py | |
parent | c1ccc88d0769afc16363ceb06e5bdcd8605455bf (diff) |
UserProfile model and fields shuffle
Move this model into the devel/ application, and move the PGPKeyField
which is used only by these models into the application as well. This
involves updating some old migrations along the way to ensure we don't
reference a field class that no longer exists.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel/admin.py')
-rw-r--r-- | devel/admin.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/devel/admin.py b/devel/admin.py index 717ba1b2..5a704c0b 100644 --- a/devel/admin.py +++ b/devel/admin.py @@ -1,6 +1,18 @@ from django.contrib import admin +from django.contrib.auth.admin import UserAdmin +from django.contrib.auth.models import User -from .models import MasterKey, PGPSignature +from .models import UserProfile, MasterKey, PGPSignature + + +class UserProfileInline(admin.StackedInline): + model = UserProfile + + +class UserProfileAdmin(UserAdmin): + inlines = [UserProfileInline] + list_display = ('username', 'email', 'first_name', 'last_name', 'is_staff', 'is_active') + list_filter = ('is_staff', 'is_superuser', 'is_active') class MasterKeyAdmin(admin.ModelAdmin): @@ -8,6 +20,7 @@ class MasterKeyAdmin(admin.ModelAdmin): search_fields = ('pgp_key', 'owner', 'revoker') date_hierarchy = 'created' + class PGPSignatureAdmin(admin.ModelAdmin): list_display = ('signer', 'signee', 'created', 'expires', 'valid') list_filter = ('valid',) @@ -15,6 +28,9 @@ class PGPSignatureAdmin(admin.ModelAdmin): date_hierarchy = 'created' +admin.site.unregister(User) +admin.site.register(User, UserProfileAdmin) + admin.site.register(MasterKey, MasterKeyAdmin) admin.site.register(PGPSignature, PGPSignatureAdmin) |