diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-08-05 17:57:23 +0200 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2015-08-05 17:57:23 +0200 |
commit | 7190134a02477d1a9c51d7fb116cb23af468c3f3 (patch) | |
tree | db0b9fc541e87347d52881efc91ccbf138dff65e /pyaggr3g470r | |
parent | Updated translations. (diff) | |
download | newspipe-7190134a02477d1a9c51d7fb116cb23af468c3f3.tar.gz newspipe-7190134a02477d1a9c51d7fb116cb23af468c3f3.tar.bz2 newspipe-7190134a02477d1a9c51d7fb116cb23af468c3f3.zip |
Ensuere that the arguments is an integer.
Diffstat (limited to 'pyaggr3g470r')
-rw-r--r-- | pyaggr3g470r/views/feed.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pyaggr3g470r/views/feed.py b/pyaggr3g470r/views/feed.py index bdb4f046..c369919c 100644 --- a/pyaggr3g470r/views/feed.py +++ b/pyaggr3g470r/views/feed.py @@ -132,10 +132,9 @@ def update(action, feed_id=None): readed = action == 'read' filters = {'readed__ne': readed} - nb_days = request.args.get('nb_days', None) - if nb_days is not None: - delete_before = datetime.now() - timedelta(days=int(nb_days)) - filters['date__lt'] = delete_before + nb_days = request.args.get('nb_days', 0, type=int) + if nb_days != 0: + filters['date__lt'] = datetime.now() - timedelta(days=nb_days) if feed_id: filters['feed_id'] = feed_id |