Code

Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#7555 closed (worksforme)

Django admin bug: Can't edit content not in Queryset

Reported by: artagnon Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: manager queryset get_query_set
Cc: Triage Stage: Fixed on a branch
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

When the default manager's get_query_set() is overridden to narrow down the queryset, django's admin interface displays all the articles for the model regardless but clicking on one of the articles not in the queryset in an attempt to modify it throws up an error similar to:
writeup object with primary key u'3' does not exist
In my opinion, if Django wants to use the default manager, the articles not in the queryset shouldn't appear in the list. Ofcourse, this problem is easily fixed by overriding the get_query_set() only in an alternate manager and not in the default manager.

Attachments (0)

Change History (2)

comment:1 Changed 6 years ago by Karen Tracey <kmtracey@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed
  • Triage Stage changed from Unreviewed to Fixed on a branch

Using newforms-admin, I don't get items excluded by the default manager listed on the admin page for the model (whereas I do when using the exact same model code in trunk admin). So I believe this is something already fixed in newforms-admin.

comment:2 Changed 3 years ago by jacob

  • milestone 1.0 deleted

Milestone 1.0 deleted

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.