Skip to content

Commit 6a7582d

Browse files
committed
fix: Only clear the cache when the feed url or filters have changed
Right now it clears the cache when storing the cache, oops
1 parent d1fccbe commit 6a7582d

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

example/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "django-rss-filter"
3-
version = "0.10.0"
3+
version = "0.10.1"
44
description = "Filter public RSS feeds, remove articles that contain certain keywords or categories."
55
authors = [
66
{name = "Kevin Renskers", email = "kevin@loopwerk.io"},

rssfilter/models.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,16 @@ def clean(self):
3636
raise ValidationError({"feed_url": result.error})
3737

3838
def save(self, *args, **kwargs):
39-
self.cache_date = None
40-
self.filtered_feed_body = ""
39+
if self.pk:
40+
old = FilteredFeed.objects.get(pk=self.pk)
41+
if (
42+
old.feed_url != self.feed_url
43+
or old.filtered_words != self.filtered_words
44+
or old.filtered_categories != self.filtered_categories
45+
):
46+
self.cache_date = None
47+
self.filtered_feed_body = ""
48+
4149
super().save(*args, **kwargs)
4250

4351
def get_filtered_feed_body(self) -> str:

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)