aboutsummaryrefslogtreecommitdiff
path: root/src/web/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'src/web/controllers')
-rw-r--r--src/web/controllers/article.py2
-rw-r--r--src/web/controllers/feed.py9
2 files changed, 9 insertions, 2 deletions
diff --git a/src/web/controllers/article.py b/src/web/controllers/article.py
index a8788f46..3d8d5c01 100644
--- a/src/web/controllers/article.py
+++ b/src/web/controllers/article.py
@@ -45,7 +45,7 @@ class ArticleController(AbstractController):
attrs.get('user_id', self.user_id)).get(id=attrs['feed_id'])
if 'user_id' in attrs:
assert feed.user_id == attrs['user_id'] or self.user_id is None
- attrs['user_id'] = feed.user_id
+ attrs['user_id'], attrs['category_id'] = feed.user_id, feed.category_id
# handling feed's filters
for filter_ in feed.filters or []:
diff --git a/src/web/controllers/feed.py b/src/web/controllers/feed.py
index 15be8663..3b05b294 100644
--- a/src/web/controllers/feed.py
+++ b/src/web/controllers/feed.py
@@ -66,5 +66,12 @@ class FeedController(AbstractController):
return super().create(**attrs)
def update(self, filters, attrs):
+ from .article import ArticleController
self._ensure_icon(attrs)
- return super().update(filters, attrs)
+ result = super().update(filters, attrs)
+ if 'category_id' in attrs:
+ art_contr = ArticleController(self.user_id)
+ for feed in self.read(**filters):
+ art_contr.update({'feed_id': feed.id},
+ {'category_id': feed.category_id})
+ return result
bgstack15