def pre_save(self, model_instance, add):
        """Remove dashes, spaces, and convert isbn to uppercase before saving
        when clean_isbn is enabled"""
        value = getattr(model_instance, self.attname)
        if self.clean_isbn and value not in EMPTY_VALUES:
            cleaned_isbn = value.replace(' ', '').replace('-', '').upper()
            setattr(model_instance, self.attname, cleaned_isbn)
        return super(ISBNField, self).pre_save(model_instance, add)
Remove dashes, spaces, and convert isbn to uppercase before saving
        when clean_isbn is enabled