[Django] #30034: Shows wrong user on list_display in LogEntryAdmin

21 views
Skip to first unread message

Django

unread,
Dec 12, 2018, 7:11:37 AM12/12/18
to django-...@googlegroups.com
#30034: Shows wrong user on list_display in LogEntryAdmin
-------------------------------------+-------------------------------------
Reporter: Muslu Y. | Owner: nobody
Type: Bug | Status: new
Component: | Version: 2.1
contrib.admin | Keywords: logentry,
Severity: Normal | logentryadmin, list_display, wrong
Triage Stage: | user
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
Hi all;

Logs are listed wrongly at list records on page (list_display -
change_list.html).

For example;
Wrong user (username:muslu) in **/admin/admin/logentry/**
True user (username:admin) in **/admin/admin/logentry/1/change/**


{{{
class LogEntryAdmin(admin.ModelAdmin):
list_display = ['content_type', 'user', 'object_repr', 'action_time']
list_filter = ['user', 'content_type']
}}}

Django: 2.1.3
settings.AUTH_USER_MODEL: default
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)

--
Ticket URL: <https://code.djangoproject.com/ticket/30034>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 12, 2018, 7:11:51 AM12/12/18
to django-...@googlegroups.com
#30034: Shows wrong user on list_display in LogEntryAdmin
-------------------------------------+-------------------------------------
Reporter: Muslu Y. | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:
Keywords: logentry, | Triage Stage:
logentryadmin, list_display, | Unreviewed
wrong user |

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Muslu Y.):

* Attachment "DeepinEkranGörüntüsü_alan-seç_20181212151005.png" added.

Django

unread,
Dec 12, 2018, 7:11:58 AM12/12/18
to django-...@googlegroups.com
#30034: Shows wrong user on list_display in LogEntryAdmin
-------------------------------------+-------------------------------------
Reporter: Muslu Y. | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:
Keywords: logentry, | Triage Stage:
logentryadmin, list_display, | Unreviewed
wrong user |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Muslu Y.):

* Attachment "DeepinEkranGörüntüsü_alan-seç_20181212150939.png" added.

Django

unread,
Dec 12, 2018, 10:52:17 AM12/12/18
to django-...@googlegroups.com
#30034: Shows wrong user on list_display in LogEntryAdmin
-------------------------------------+-------------------------------------
Reporter: Muslu Y. | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution: needsinfo

Keywords: logentry, | Triage Stage:
logentryadmin, list_display, | Unreviewed
wrong user |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* status: new => closed
* resolution: => needsinfo


Comment:

Hi.

You need to reduce this down to a minimal example showing Django is at
fault.

There's really not enough info here for me to see what you issue could be.
Without a reproduce it's hard to see how we could push this forward.

--
Ticket URL: <https://code.djangoproject.com/ticket/30034#comment:1>

Django

unread,
Dec 13, 2018, 1:58:31 AM12/13/18
to django-...@googlegroups.com
#30034: Shows wrong user on list_display in LogEntryAdmin
-------------------------------------+-------------------------------------
Reporter: Muslu Y. | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution: needsinfo
Keywords: logentry, | Triage Stage:
logentryadmin, list_display, | Unreviewed
wrong user |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Muslu Y.):

* Attachment "admin_app_model_1593_history.png" added.

Django

unread,
Dec 13, 2018, 1:58:37 AM12/13/18
to django-...@googlegroups.com
#30034: Shows wrong user on list_display in LogEntryAdmin
-------------------------------------+-------------------------------------
Reporter: Muslu Y. | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution: needsinfo
Keywords: logentry, | Triage Stage:
logentryadmin, list_display, | Unreviewed
wrong user |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Muslu Y.):

* Attachment "admin_admin_logentry.png" added.

Django

unread,
Dec 13, 2018, 1:58:43 AM12/13/18
to django-...@googlegroups.com
#30034: Shows wrong user on list_display in LogEntryAdmin
-------------------------------------+-------------------------------------
Reporter: Muslu Y. | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution: needsinfo
Keywords: logentry, | Triage Stage:
logentryadmin, list_display, | Unreviewed
wrong user |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Muslu Y.):

* Attachment "admin_admin_logentry_2228_change.png" added.

Django

unread,
Dec 13, 2018, 2:00:09 AM12/13/18
to django-...@googlegroups.com
#30034: Shows wrong user on list_display in LogEntryAdmin
-------------------------------------+-------------------------------------
Reporter: Muslu Y. | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution: needsinfo
Keywords: logentry, | Triage Stage:
logentryadmin, list_display, | Unreviewed
wrong user |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Muslu Y.:

Old description:

> Hi all;
>
> Logs are listed wrongly at list records on page (list_display -
> change_list.html).
>
> For example;
> Wrong user (username:muslu) in **/admin/admin/logentry/**
> True user (username:admin) in **/admin/admin/logentry/1/change/**
>

> {{{
> class LogEntryAdmin(admin.ModelAdmin):
> list_display = ['content_type', 'user', 'object_repr', 'action_time']
> list_filter = ['user', 'content_type']
> }}}
>

>
> Django: 2.1.3
> settings.AUTH_USER_MODEL: default
> 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)

New description:

Hi;

This is my admin.py in custom application.

admin.py:

{{{

from django.contrib.admin.models import LogEntry

class LogEntryAdmin(admin.ModelAdmin):
list_display = ['content_type', 'user', 'object_id', 'object_repr',
'action_time']
date_hierarchy = 'action_time'


list_filter = ['user', 'content_type']

ordering = ['-action_time']

def has_add_permission(self, request):
return False

def has_change_permission(self, request, obj=None):
return False

def has_delete_permission(self, request, obj=None):
return False

admin.site.register(LogEntry,LogEntryAdmin)

}}}


If I checked **/admin/app/model/1593/history/** and
**/admin/admin/logentry/** on model's history, It's showing wrong user who
changed record.

But when I entering **/admin/admin/logentry/2228/change/** then It's
showing True user in page.

I added screen shots.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/30034#comment:2>

Django

unread,
Dec 13, 2018, 2:59:25 AM12/13/18
to django-...@googlegroups.com
#30034: Shows wrong user on list_display in LogEntryAdmin
-------------------------------------+-------------------------------------
Reporter: Muslu Y. | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution: needsinfo
Keywords: logentry, | Triage Stage:
logentryadmin, list_display, | Unreviewed
wrong user |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

Hi Muslu.

There's still not enough to show Django is at fault here. `LogEntry`
objects have a `user_id` field. That points to a user.


You originally had this in your description:

{{{
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)
}}}

As soon as you mention this I suspect you're somehow NOT routing to the
same users table each time. (But you need to investigate that: this isn't
a support channel.)

Happy to look at this if you can create a minimal project (using
`startproject` and adding just what you need to) that reproduces the error
and shows Django is at fault.

--
Ticket URL: <https://code.djangoproject.com/ticket/30034#comment:3>

Django

unread,
Dec 13, 2018, 3:51:08 AM12/13/18
to django-...@googlegroups.com
#30034: Shows wrong user on list_display in LogEntryAdmin
-------------------------------------+-------------------------------------
Reporter: Muslu Y. | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution:
Keywords: logentry, | Triage Stage:
logentryadmin, list_display, | Unreviewed
wrong user |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Muslu Y.):

* status: closed => new
* resolution: needsinfo =>


Comment:

Hi Carlton;

Thank you for taking the time to this problem.

I want to say that, LogEntry is using settings.AUTH_USER_MODEL for user
but if we want to use auth_db for route (AuthRoute) then showing wrong
user, because user_id is not same like you say.

May be this is not bug but this is a problem. I created and tested a blank
project as usual and worked correctly.

How can I provide you with more information to solve the problem?

--
Ticket URL: <https://code.djangoproject.com/ticket/30034#comment:4>

Django

unread,
Dec 13, 2018, 4:34:54 AM12/13/18
to django-...@googlegroups.com
#30034: Shows wrong user on list_display in LogEntryAdmin
-------------------------------------+-------------------------------------
Reporter: Muslu Y. | Owner: nobody
Type: Bug | Status: closed
Component: contrib.admin | Version: 2.1
Severity: Normal | Resolution: invalid

Keywords: logentry, | Triage Stage:
logentryadmin, list_display, | Unreviewed
wrong user |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* status: new => closed

* resolution: => invalid


Comment:

See TicketClosingReasons/UseSupportChannels

--
Ticket URL: <https://code.djangoproject.com/ticket/30034#comment:5>

Reply all
Reply to author
Forward
0 new messages