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 a8121c4 commit 4a10ca4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modeltranslation/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ def is_hidden(field: ForeignObjectRel) -> bool:

def clear_ForeignObjectRel_caches(field: ForeignObjectRel):
"""
Django 5.1 Introduced caching for `accessor_name` and `cache_name` props.
Django 5.1 Introduced caching for `accessor_name` props.
We need to clear this cache when creating Translated field.
https://github.com/django/django/commit/5e80390add100e0c7a1ac8e51739f94c5d706ea3#diff-e65b05ecbbe594164125af53550a43ef8a174f80811608012bc8e9e4ed575749
"""
caches = ("accessor_name", "cache_name")
caches = ("accessor_name",)
for name in caches:
field.__dict__.pop(name, None)

Expand Down

0 comments on commit 4a10ca4

Please sign in to comment.