Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 25, 2024
1 parent a294196 commit b81fbc1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions simple_history/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Check warning on line 335 in simple_history/models.py

View check run for this annotation

Codecov / codecov/patch

simple_history/models.py#L334-L335

Added lines #L334 - L335 were not covered by tests
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 = (

Check warning on line 337 in simple_history/models.py

View check run for this annotation

Codecov / codecov/patch

simple_history/models.py#L337

Added line #L337 was not covered by tests
old_field.max_length if old_field.max_length else 255
)
if field.__class__.__name__ == "TranslationTextField":
old_field = field
field.__class__ = models.TextField

Check warning on line 342 in simple_history/models.py

View check run for this annotation

Codecov / codecov/patch

simple_history/models.py#L341-L342

Added lines #L341 - L342 were not covered by tests
if isinstance(field, OrderWrt):
Expand Down

0 comments on commit b81fbc1

Please sign in to comment.