Changes between Initial Version and Version 2 of Ticket #30034


Ignore:
Timestamp:
Dec 13, 2018, 1:00:07 AM (5 years ago)
Author:
Muslu Y.
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #30034

    • Property Resolutionneedsinfo
    • Property Status newclosed
  • Ticket #30034 – Description

    initial v2  
    1 Hi all;
     1Hi;
    22
    3 Logs are listed wrongly at list records on page (list_display - change_list.html).
     3This is my admin.py in custom application.
    44
    5 For example;
    6 Wrong user (username:muslu) in **/admin/admin/logentry/**
    7 True user (username:admin) in **/admin/admin/logentry/1/change/**
    8 
     5admin.py:
    96
    107{{{
     8
     9from django.contrib.admin.models import LogEntry
     10
    1111class LogEntryAdmin(admin.ModelAdmin):
    12     list_display = ['content_type', 'user', 'object_repr', 'action_time']
     12    list_display = ['content_type', 'user', 'object_id', 'object_repr', 'action_time']
     13    date_hierarchy = 'action_time'
    1314    list_filter = ['user', 'content_type']
     15    ordering =  ['-action_time']
     16
     17    def has_add_permission(self, request):
     18        return False
     19
     20    def has_change_permission(self, request, obj=None):
     21        return False
     22
     23    def has_delete_permission(self, request, obj=None):
     24        return False
     25
     26admin.site.register(LogEntry,LogEntryAdmin)
     27
    1428}}}
    1529
    1630
     31If I checked **/admin/app/model/1593/history/** and **/admin/admin/logentry/** on model's history, It's showing wrong user who changed record.
    1732
    18 Django: 2.1.3
    19 settings.AUTH_USER_MODEL: default
    20 DATABASE_ROUTERS: at this system we are using 2 projects on different servers but we are accessing both project from one SQL server. So we use only one SQL user table. (Users are same for all projects.) (router.AuthRouter)
     33But when I entering **/admin/admin/logentry/2228/change/** then It's showing True user in page.
     34
     35I added screen shots.
Back to Top