From 01732d4f724596e59d8916dd583773d068f01c89 Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Sat, 18 Feb 2006 17:44:31 +0000 Subject: [PATCH] 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 --- django/db/models/fields/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 867d6f81a5..6c1c54ff4a 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -476,8 +476,8 @@ class FileField(Field): dispatcher.connect(self.delete_file, signal=signals.post_delete, sender=cls) def delete_file(self, instance): - if getattr(instance, f.attname): - file_name = getattr(instance, 'get_%s_filename' % f.name)() + if getattr(instance, self.attname): + file_name = getattr(instance, 'get_%s_filename' % self.name)() # 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 \