Show More
@@ -8,13 +8,14 b' from boards.models import Post, Tag, Ban' | |||
|
8 | 8 | @admin.register(Post) |
|
9 | 9 | class PostAdmin(admin.ModelAdmin): |
|
10 | 10 | |
|
11 |
list_display = ('id', 'title', 'text', 'poster_ip', 'linked_images', |
|
|
11 | list_display = ('id', 'title', 'text', 'poster_ip', 'linked_images', | |
|
12 | 'foreign') | |
|
12 | 13 | list_filter = ('pub_time',) |
|
13 | 14 | search_fields = ('id', 'title', 'text', 'poster_ip') |
|
14 | 15 | exclude = ('referenced_posts', 'refmap', 'images', 'global_id') |
|
15 | 16 | readonly_fields = ('poster_ip', 'threads', 'thread', 'linked_images', |
|
16 | 17 | 'attachments', 'uid', 'url', 'pub_time', 'opening', 'linked_global_id', |
|
17 | 'version') | |
|
18 | 'version', 'foreign') | |
|
18 | 19 | |
|
19 | 20 | def ban_poster(self, request, queryset): |
|
20 | 21 | bans = 0 |
@@ -61,6 +62,10 b' class PostAdmin(admin.ModelAdmin):' | |||
|
61 | 62 | obj.save() |
|
62 | 63 | obj.clear_cache() |
|
63 | 64 | |
|
65 | def foreign(self, obj: Post): | |
|
66 | return obj is not None and obj.global_id is not None and\ | |
|
67 | not obj.global_id.is_local() | |
|
68 | ||
|
64 | 69 | actions = ['ban_poster', 'ban_with_hiding'] |
|
65 | 70 | |
|
66 | 71 |
General Comments 0
You need to be logged in to leave comments.
Login now