summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorSimon Charette <charettes@users.noreply.github.com>2018-01-02 09:42:24 -0500
committerTim Graham <timograham@gmail.com>2018-01-02 09:42:24 -0500
commitf5a989e60394ac11f5dce886468a34533caefcbf (patch)
tree94edaf89d211ef502cfe059ab3fd55ddfe81657a /django
parent0f5a741ada39f5ac193b9b9cfc00088ebd325f32 (diff)
Fixed #28974 -- Made refresh_from_db() hint routers about its instance.
Diffstat (limited to 'django')
-rw-r--r--django/db/models/base.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index 5633fff89a..19648fbed9 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -590,8 +590,8 @@ class Model(metaclass=ModelBase):
'Found "%s" in fields argument. Relations and transforms '
'are not allowed in fields.' % LOOKUP_SEP)
- db = using if using is not None else self._state.db
- db_instance_qs = self.__class__._base_manager.using(db).filter(pk=self.pk)
+ hints = {'instance': self}
+ db_instance_qs = self.__class__._base_manager.db_manager(using, hints=hints).filter(pk=self.pk)
# Use provided fields, if not set then reload all non-deferred fields.
deferred_fields = self.get_deferred_fields()