summaryrefslogtreecommitdiffstats
path: root/users
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-27 17:16:09 -0700
committerAndrew Godwin2022-11-27 17:16:09 -0700
commit0221ea261fe32b30d441ea10ea39256c0f9b82e3 (patch)
tree69ed72c027d8fac60c952c20beb353e71af23dbd /users
parent3b079526a2ea78b68555094ca498faea31022759 (diff)
downloadtakahe-0221ea261fe32b30d441ea10ea39256c0f9b82e3.tar.gz
takahe-0221ea261fe32b30d441ea10ea39256c0f9b82e3.tar.bz2
takahe-0221ea261fe32b30d441ea10ea39256c0f9b82e3.zip
Admin tweaks
Diffstat (limited to 'users')
-rw-r--r--users/admin.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/users/admin.py b/users/admin.py
index 235b0db..d498343 100644
--- a/users/admin.py
+++ b/users/admin.py
@@ -20,11 +20,13 @@ class DomainAdmin(admin.ModelAdmin):
@admin.register(User)
class UserAdmin(admin.ModelAdmin):
list_display = ["email", "created", "last_seen", "admin", "moderator", "banned"]
+ search_fields = ["email"]
@admin.register(UserEvent)
class UserEventAdmin(admin.ModelAdmin):
- pass
+ def has_add_permission(self, request, obj=None):
+ return False
@admin.register(Identity)
@@ -34,6 +36,7 @@ class IdentityAdmin(admin.ModelAdmin):
raw_id_fields = ["users"]
actions = ["force_update"]
readonly_fields = ["actor_json"]
+ search_fields = ["username", "name"]
@admin.action(description="Force Update")
def force_update(self, request, queryset):
@@ -45,9 +48,6 @@ class IdentityAdmin(admin.ModelAdmin):
return instance.to_ap()
def has_add_permission(self, request, obj=None):
- """
- Disables admin creation of identities as it will skip steps
- """
return False
@@ -56,12 +56,18 @@ class FollowAdmin(admin.ModelAdmin):
list_display = ["id", "source", "target", "state"]
raw_id_fields = ["source", "target"]
+ def has_add_permission(self, request, obj=None):
+ return False
+
@admin.register(PasswordReset)
class PasswordResetAdmin(admin.ModelAdmin):
list_display = ["id", "user", "created"]
raw_id_fields = ["user"]
+ def has_add_permission(self, request, obj=None):
+ return False
+
@admin.register(InboxMessage)
class InboxMessageAdmin(admin.ModelAdmin):
@@ -75,6 +81,9 @@ class InboxMessageAdmin(admin.ModelAdmin):
for instance in queryset:
instance.transition_perform("received")
+ def has_add_permission(self, request, obj=None):
+ return False
+
@admin.register(Invite)
class InviteAdmin(admin.ModelAdmin):