mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #25547 -- Made Model.refresh_from_db() update FileField's instance.
This commit is contained in:
		| @@ -202,6 +202,10 @@ class FileDescriptor(object): | ||||
|             file.field = self.field | ||||
|             file.storage = self.field.storage | ||||
|  | ||||
|         # Make sure that the instance is correct. | ||||
|         elif isinstance(file, FieldFile) and instance is not file.instance: | ||||
|             file.instance = instance | ||||
|  | ||||
|         # That was fun, wasn't it? | ||||
|         return instance.__dict__[self.field.name] | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user