New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display change log in admin for superusers #952
Conversation
judge/admin/interface.py
Outdated
object_link.short_description = 'object' | ||
|
||
def queryset(self, request): | ||
return super(LogEntryAdmin, self).queryset(request).prefetch_related('content_type') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just super()
now we are python 3.
judge/admin/interface.py
Outdated
link = obj.object_repr | ||
return link | ||
object_link.admin_order_field = 'object_repr' | ||
object_link.short_description = 'object' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be marked for i18n.
judge/admin/interface.py
Outdated
return False | ||
|
||
def has_change_permission(self, request, obj=None): | ||
return request.user.is_superuser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if superusers should be able to forge records...
readonly_fields = ('user', 'content_type', 'object_id', 'object_repr', 'action_flag', 'change_message') | ||
list_display = ('__str__', 'action_time', 'user', 'content_type', 'object_link') | ||
search_fields = ('object_repr', 'change_message') | ||
list_filter = ('user', 'content_type') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhhhh... this lists all the users on the site. That's... excessive.
Fixes #755.