diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-04-06 23:59:01 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-04-06 23:59:01 +0200 |
commit | a0a3bda9340a57203391400a5ac32e87281e8a19 (patch) | |
tree | 040d69d70cb9e2b649259052ecc1f6984b123db2 /src/web/controllers | |
parent | major problems fixed. (diff) | |
parent | create a new user is now working (diff) | |
download | newspipe-a0a3bda9340a57203391400a5ac32e87281e8a19.tar.gz newspipe-a0a3bda9340a57203391400a5ac32e87281e8a19.tar.bz2 newspipe-a0a3bda9340a57203391400a5ac32e87281e8a19.zip |
Fixed merge conflicts.
Diffstat (limited to 'src/web/controllers')
-rw-r--r-- | src/web/controllers/feed.py | 4 | ||||
-rw-r--r-- | src/web/controllers/user.py | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/src/web/controllers/feed.py b/src/web/controllers/feed.py index 95b1eceb..a3f5cae7 100644 --- a/src/web/controllers/feed.py +++ b/src/web/controllers/feed.py @@ -84,7 +84,9 @@ class FeedController(AbstractController): def update(self, filters, attrs): from .article import ArticleController self._ensure_icon(attrs) - if 'category_id' in attrs: + if 'category_id' in attrs and attrs['category_id'] == 0: + del attrs['category_id'] + elif 'category_id' in attrs: art_contr = ArticleController(self.user_id) for feed in self.read(**filters): art_contr.update({'feed_id': feed.id}, diff --git a/src/web/controllers/user.py b/src/web/controllers/user.py index ee2eb4c2..1b5c123e 100644 --- a/src/web/controllers/user.py +++ b/src/web/controllers/user.py @@ -1,9 +1,10 @@ -import random -import hashlib +import logging from werkzeug import generate_password_hash, check_password_hash from .abstract import AbstractController from web.models import User +logger = logging.getLogger(__name__) + class UserController(AbstractController): _db_cls = User @@ -11,7 +12,7 @@ class UserController(AbstractController): def _handle_password(self, attrs): if attrs.get('password'): - attrs['pwdhash'] = generate_password_hash(attrs.pop('password')) + attrs['password'] = generate_password_hash(attrs.pop('password')) elif 'password' in attrs: del attrs['password'] |