magic-removal: Fixed an old variable name error in delete_file() for FileFields

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2335 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2006-02-18 17:44:31 +00:00
parent 2dbd56795e
commit 01732d4f72
1 changed files with 2 additions and 2 deletions

View File

@ -476,8 +476,8 @@ class FileField(Field):
dispatcher.connect(self.delete_file, signal=signals.post_delete, sender=cls) dispatcher.connect(self.delete_file, signal=signals.post_delete, sender=cls)
def delete_file(self, instance): def delete_file(self, instance):
if getattr(instance, f.attname): if getattr(instance, self.attname):
file_name = getattr(instance, 'get_%s_filename' % f.name)() file_name = getattr(instance, 'get_%s_filename' % self.name)()
# If the file exists and no other object of this type references it, # If the file exists and no other object of this type references it,
# delete it from the filesystem. # delete it from the filesystem.
if os.path.exists(file_name) and \ if os.path.exists(file_name) and \