Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
last-partizan committed Nov 9, 2024
1 parent 4f37590 commit a8121c4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions modeltranslation/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
def is_hidden(field: ForeignObjectRel) -> bool:
return field.hidden


def clear_ForeignObjectRel_caches(field: ForeignObjectRel):
"""
Django 5.1 Introduced caching for `accessor_name` and `cache_name` props.
Expand All @@ -23,6 +24,7 @@ def clear_ForeignObjectRel_caches(field: ForeignObjectRel):
for name in caches:
field.__dict__.pop(name, None)


if django.VERSION <= (5, 1):

def is_hidden(field: ForeignObjectRel) -> bool:
Expand Down
1 change: 0 additions & 1 deletion modeltranslation/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ def __init__(
# Update the dict of this field with the content of the original one
# This might be a bit radical?! Seems to work though...
self.__dict__.update(translated_field.__dict__)
assert 'accessor_name' not in self.__dict__

# Store the originally wrapped field for later
self.translated_field = translated_field
Expand Down
1 change: 0 additions & 1 deletion modeltranslation/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from contextlib import contextmanager
from typing import Any, TypeVar
from collections.abc import Generator, Iterable, Iterator
from functools import cached_property
from django.db import models
from django.utils.encoding import force_str
from django.utils.functional import lazy
Expand Down

0 comments on commit a8121c4

Please sign in to comment.