Skip to content

Commit

Permalink
Clean old Django
Browse files Browse the repository at this point in the history
  • Loading branch information
radiac committed Oct 25, 2020
1 parent 3731f01 commit 48a27df
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tagulous/models/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,8 @@ def flush_cache(self):
Must be called after all
"""
# Django 2.0 changes cache management
if hasattr(self.field, "get_cached_value"):
if self.field.is_cached(self.instance):
self.field.delete_cached_value(self.instance)
else:
# Django <2.0
cache_name = self.field.get_cache_name()
if hasattr(self.instance, cache_name):
delattr(self.instance, cache_name)
if self.field.is_cached(self.instance):
self.field.delete_cached_value(self.instance)

def get_actual(self):
"""
Expand Down

0 comments on commit 48a27df

Please sign in to comment.