SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit c07c6e83 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Update comments admin

parent c6821054
No related branches found
No related tags found
No related merge requests found
...@@ -15,11 +15,18 @@ def comment_is_vetted(comment): ...@@ -15,11 +15,18 @@ def comment_is_vetted(comment):
return comment.status is STATUS_VETTED return comment.status is STATUS_VETTED
def comment_is_anonymous(comment):
'''Check if comment is vetted.'''
return comment.anonymous
class CommentAdmin(GuardedModelAdmin): class CommentAdmin(GuardedModelAdmin):
list_display = (comment_opening, 'author', 'date_submitted', comment_is_vetted) list_display = (
comment_opening, 'author', 'date_submitted', comment_is_vetted, comment_is_anonymous)
date_hierarchy = 'date_submitted' date_hierarchy = 'date_submitted'
list_filter = ('status',) list_filter = ('status',)
comment_is_vetted.boolean = True comment_is_vetted.boolean = True
comment_is_anonymous.boolean = True
admin.site.register(Comment, CommentAdmin) admin.site.register(Comment, CommentAdmin)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment