Ticket #2983: image_field_delete_orig_on_update.patch
File image_field_delete_orig_on_update.patch, 712 bytes (added by , 18 years ago) |
---|
-
__init__.py
666 666 667 667 def save_file(self, new_data, new_object, original_object, change, rel): 668 668 FileField.save_file(self, new_data, new_object, original_object, change, rel) 669 upload_field_name = self.get_manipulator_field_names('')[0] 670 if new_data.get(upload_field_name, False) and change: 671 self.delete_file(original_object) # delete original file 669 672 # If the image has height and/or width field(s) and they haven't 670 673 # changed, set the width and/or height field(s) back to their original 671 674 # values.