mirror of
https://github.com/django/django.git
synced 2025-06-08 21:19:13 +00:00
magic-removal: Fixed old-style DB API call in FileField.delete_file()
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2264 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
98ff9555f8
commit
9881e049d0
@ -481,7 +481,7 @@ class FileField(Field):
|
||||
# If the file exists and no other object of this type references it,
|
||||
# delete it from the filesystem.
|
||||
if os.path.exists(file_name) and \
|
||||
not instance.__class__._default_manager.get_list(**{'%s__exact' % self.name: getattr(instance, self.attname)}):
|
||||
not instance.__class__._default_manager.filter(**{'%s__exact' % self.name: getattr(instance, self.attname)}):
|
||||
os.remove(file_name)
|
||||
|
||||
def get_manipulator_field_objs(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user