Skip to content
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

Merged
merged 2 commits into from Apr 18, 2019

Conversation

Ninjaclasher
Copy link
Member

Fixes #755.

@quantum5 quantum5 changed the title Display change log in admin for superusers. Display change log in admin for superusers Apr 16, 2019
object_link.short_description = 'object'

def queryset(self, request):
return super(LogEntryAdmin, self).queryset(request).prefetch_related('content_type')
Copy link
Member

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.

link = obj.object_repr
return link
object_link.admin_order_field = 'object_repr'
object_link.short_description = 'object'
Copy link
Member

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.

return False

def has_change_permission(self, request, obj=None):
return request.user.is_superuser
Copy link
Member

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...

@quantum5 quantum5 merged commit 0283132 into DMOJ:master Apr 18, 2019
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')
Copy link
Member

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.

@Ninjaclasher Ninjaclasher deleted the admin-log branch April 19, 2019 18:41
malbareda pushed a commit to malbareda/JOEL-web that referenced this pull request Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display change log in admin for superusers only
2 participants