From b81fbc1598c2512be4bc0f6d55c4c4fb77041dec Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 21:51:10 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- simple_history/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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):