#35520: ModelAdmin uses incorrect database in change and delete views
-------------------------------+---------------------------------------
     Reporter:  Jake Howard    |                    Owner:  Jake Howard
         Type:  Bug            |                   Status:  assigned
    Component:  contrib.admin  |                  Version:  dev
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+---------------------------------------
Comment (by Jake Howard):

 I suspect we don't want to create a transaction in the first place if
 we're using `db_for_read`?

 Perhaps not, but keeping the transaction is less likely to break any
 existing behaviour, not to mention making more sure the view is internally
 consistent. Changing the database is going to be less impactful than
 removing a transaction.

     I worry about admin extensions that might create access records
 against the write database and might start failing here.

 Django's built-in `LogEntry` only logs writes ("Addition", "Change",
 "Deletion"), so simply viewing a model shouldn't trigger any writes. I
 could add a test for this, but not sure whether that's overkill.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35520#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701900877683c-140529ad-e494-4ee0-957a-bc9cd4013ede-000000%40eu-central-1.amazonses.com.

Reply via email to