diff --git a/simple_history/models.py b/simple_history/models.py index 53ee8f56..d131e5e2 100644 --- a/simple_history/models.py +++ b/simple_history/models.py @@ -330,12 +330,14 @@ def copy_fields(self, model): for field in self.fields_included(model): field = copy.copy(field) field.remote_field = copy.copy(field.remote_field) - if field.__class__.__name__ == 'TranslationCharField': + if field.__class__.__name__ == "TranslationCharField": old_field = field field.__class__ = models.CharField if hasattr(field, "max_length"): - field.max_length = old_field.max_length if old_field.max_length else 255 - if field.__class__.__name__ == 'TranslationTextField': + field.max_length = ( + old_field.max_length if old_field.max_length else 255 + ) + if field.__class__.__name__ == "TranslationTextField": old_field = field field.__class__ = models.TextField if isinstance(field, OrderWrt):