SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 6b0ebe00 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Correct Comment admin

parent f338cc53
No related merge requests found
......@@ -4,13 +4,17 @@ from .constants import STATUS_VETTED
from .models import Comment
def comment_opening(comment):
return comment.comment_text[:30] + '...'
def comment_is_vetted(comment):
'''Check if comment is vetted.'''
return comment.status is STATUS_VETTED
class CommentAdmin(admin.ModelAdmin):
list_display = ('comment_text', 'author', 'date_submitted', comment_is_vetted)
list_display = (comment_opening, 'author', 'date_submitted', comment_is_vetted)
date_hierarchy = 'date_submitted'
list_filter = ('status',)
comment_is_vetted.boolean = True
......
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