diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2022-01-02 01:19:19 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2022-01-02 01:19:19 +0100 |
commit | e206de09468fabcc5bcd83bd1de0ff656b8c8150 (patch) | |
tree | 23a372ac3e3d24840edd373e3399383bff10cf82 /newspipe/web | |
parent | Updated psycopg2-binary. (diff) | |
download | newspipe-e206de09468fabcc5bcd83bd1de0ff656b8c8150.tar.gz newspipe-e206de09468fabcc5bcd83bd1de0ff656b8c8150.tar.bz2 newspipe-e206de09468fabcc5bcd83bd1de0ff656b8c8150.zip |
various !minor fixes
Diffstat (limited to 'newspipe/web')
-rw-r--r-- | newspipe/web/lib/user_utils.py | 2 | ||||
-rw-r--r-- | newspipe/web/views/__init__.py | 18 | ||||
-rw-r--r-- | newspipe/web/views/article.py | 3 | ||||
-rw-r--r-- | newspipe/web/views/bookmark.py | 1 | ||||
-rw-r--r-- | newspipe/web/views/session_mgmt.py | 3 | ||||
-rw-r--r-- | newspipe/web/views/user.py | 4 |
6 files changed, 23 insertions, 8 deletions
diff --git a/newspipe/web/lib/user_utils.py b/newspipe/web/lib/user_utils.py index 22cf3b6a..1191fa8f 100644 --- a/newspipe/web/lib/user_utils.py +++ b/newspipe/web/lib/user_utils.py @@ -16,6 +16,6 @@ def confirm_token(token): salt=application.config["SECURITY_PASSWORD_SALT"], max_age=application.config["TOKEN_VALIDITY_PERIOD"], ) - except: + except Exception: return False return nickname diff --git a/newspipe/web/views/__init__.py b/newspipe/web/views/__init__.py index beab0b52..950cb5b6 100644 --- a/newspipe/web/views/__init__.py +++ b/newspipe/web/views/__init__.py @@ -7,3 +7,21 @@ from newspipe.web.views.category import categories_bp, category_bp from newspipe.web.views.feed import feed_bp, feeds_bp from newspipe.web.views.icon import icon_bp from newspipe.web.views.user import user_bp + +__all__ = [ + "home", + "session_mgmt", + "views", + "admin_bp", + "v2", + "article_bp", + "articles_bp", + "bookmark_bp", + "bookmarks_bp", + "categories_bp", + "category_bp", + "feed_bp", + "feeds_bp", + "icon_bp", + "user_bp", +] diff --git a/newspipe/web/views/article.py b/newspipe/web/views/article.py index 8cea11e4..a7d4fa93 100644 --- a/newspipe/web/views/article.py +++ b/newspipe/web/views/article.py @@ -3,7 +3,6 @@ from datetime import datetime, timedelta from flask import ( Blueprint, flash, - g, make_response, redirect, render_template, @@ -14,7 +13,7 @@ from flask_babel import gettext from flask_login import current_user, login_required from newspipe.bootstrap import db -from newspipe.controllers import ArticleController, CategoryController, UserController +from newspipe.controllers import ArticleController, UserController from newspipe.lib.data import export_json from newspipe.lib.utils import clear_string, redirect_url from newspipe.web.lib.view_utils import etag_match diff --git a/newspipe/web/views/bookmark.py b/newspipe/web/views/bookmark.py index 9d6a5725..de546b7d 100644 --- a/newspipe/web/views/bookmark.py +++ b/newspipe/web/views/bookmark.py @@ -40,7 +40,6 @@ from flask import ( from flask_babel import gettext from flask_login import current_user, login_required from flask_paginate import Pagination, get_page_args -from sqlalchemy import desc, text from werkzeug.exceptions import BadRequest from newspipe.bootstrap import db diff --git a/newspipe/web/views/session_mgmt.py b/newspipe/web/views/session_mgmt.py index 90f3c141..8aa1cf60 100644 --- a/newspipe/web/views/session_mgmt.py +++ b/newspipe/web/views/session_mgmt.py @@ -7,11 +7,10 @@ from flask import ( flash, redirect, render_template, - request, session, url_for, ) -from flask_babel import gettext, lazy_gettext +from flask_babel import gettext from flask_login import LoginManager, current_user, login_required, logout_user from flask_principal import ( AnonymousIdentity, diff --git a/newspipe/web/views/user.py b/newspipe/web/views/user.py index 6643cbca..c20777e7 100644 --- a/newspipe/web/views/user.py +++ b/newspipe/web/views/user.py @@ -101,7 +101,7 @@ def management(): Display the management page. """ if request.method == "POST": - if None != request.files.get("opmlfile", None): + if None is not request.files.get("opmlfile", None): # Import an OPML file data = request.files.get("opmlfile", None) if not misc_utils.allowed_file(data.filename): @@ -115,7 +115,7 @@ def management(): flash(gettext("Downloading articles..."), "info") except Exception: flash(gettext("Impossible to import the new feeds."), "danger") - elif None != request.files.get("jsonfile", None): + elif None is not request.files.get("jsonfile", None): # Import an account data = request.files.get("jsonfile", None) if not misc_utils.allowed_file(data.filename): |