diff options
| author | Hasan Ramezani <hasan.r67@gmail.com> | 2019-03-09 13:59:55 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2019-06-06 12:09:01 +0200 |
| commit | 661e6cc2c97d9bcb45198be787409488e1825c90 (patch) | |
| tree | 5f4c07e39674cc1600601a2898dc766c8ea894e6 /django | |
| parent | 4b45b6c8e4d7c9701a332e80d3b1c84209dc36e2 (diff) | |
Fixed #29706 -- Made RenameContentType._rename() save to the correct database.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/contenttypes/management/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/contrib/contenttypes/management/__init__.py b/django/contrib/contenttypes/management/__init__.py index 2b5f688136..563cba2fdf 100644 --- a/django/contrib/contenttypes/management/__init__.py +++ b/django/contrib/contenttypes/management/__init__.py @@ -24,7 +24,7 @@ class RenameContentType(migrations.RunPython): content_type.model = new_model try: with transaction.atomic(using=db): - content_type.save(update_fields={'model'}) + content_type.save(using=db, update_fields={'model'}) except IntegrityError: # Gracefully fallback if a stale content type causes a # conflict as remove_stale_contenttypes will take care of |
