558 | | def save_file(self, new_data, new_object, original_object, change, rel): |
559 | | FileField.save_file(self, new_data, new_object, original_object, change, rel) |
560 | | # If the image has height and/or width field(s) and they haven't |
561 | | # changed, set the width and/or height field(s) back to their original |
562 | | # values. |
563 | | if change and (self.width_field or self.height_field): |
564 | | if self.width_field: |
565 | | setattr(new_object, self.width_field, getattr(original_object, self.width_field)) |
566 | | if self.height_field: |
567 | | setattr(new_object, self.height_field, getattr(original_object, self.height_field)) |
568 | | new_object.save() |
569 | | |