Skip to content

Commit d1fccbe

Browse files
committed
feat: When you edit a feed, the cached version should be removed
Closes #2
1 parent f4de766 commit d1fccbe

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

rssfilter/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ def clean(self):
3535
if not result.valid:
3636
raise ValidationError({"feed_url": result.error})
3737

38+
def save(self, *args, **kwargs):
39+
self.cache_date = None
40+
self.filtered_feed_body = ""
41+
super().save(*args, **kwargs)
42+
3843
def get_filtered_feed_body(self) -> str:
3944
five_mins_ago = timezone.now() - timedelta(seconds=RSS_FILTER_CACHE_SECONDS)
4045
if self.cache_date and self.cache_date > five_mins_ago:

0 commit comments

Comments
 (0)