#29706: RenameContentType._rename() doesn't save the content type on the correct
database
-------------------------------------+-------------------------------------
Reporter: Tyler Morgan | Owner: nobody
Type: Bug | Status: new
Component: | Version: master
contrib.contenttypes |
Severity: Normal | Resolution:
Keywords: RenameContentType | Triage Stage: Accepted
transaction atomic content_type |
update_fields using |
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Herbert Fortes):
* cc: Herbert Fortes (added)
Comment:
Hi,
I spent all afternoon into this ticket. As I am a newbie I failed to
make a test for it. And the fix can really be 'using=db' in the .save()
method.
But I found a StackOverflow answer about transaction.atomic(using=db)
that is interesting. It does not work (Django 1.10.5).
[https://stackoverflow.com/questions/41866795/multi-db-transactions,
multi-db-transactions]
The reason given is that the router is responsible for directions.
Tyler Morgan probably read the docs but I am putting it here in case
for a steps review. It has an
[https://docs.djangoproject.com/en/2.1/topics/db/multi-db/#topics-db-
multi-db-routing, example purpose only]
--
Ticket URL: <https://code.djangoproject.com/ticket/29706#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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.988f4e90190ef550330de004a1ab349b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.