From 07569ca2deae5d0ac2cc0f3298d68526dc05b9ff Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Tue, 10 Mar 2020 15:04:45 +0100 Subject: fixed issues reported by flake8. --- instance/production.py | 2 +- manager.py | 2 +- newspipe/bootstrap.py | 1 + newspipe/lib/data.py | 3 +++ newspipe/web/views/views.py | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/instance/production.py b/instance/production.py index 9dc56a76..7fd59916 100644 --- a/instance/production.py +++ b/instance/production.py @@ -41,7 +41,7 @@ MAIL_USE_SSL = False MAIL_DEBUG = DEBUG MAIL_USERNAME = None MAIL_PASSWORD = None -MAIL_DEFAULT_SENDER = ADMIN_EMAIL +MAIL_DEFAULT_SENDER = "admin@admin.localhost" # Misc BASE_DIR = os.path.abspath(os.path.dirname('.')) diff --git a/manager.py b/manager.py index bf935632..64fc38c1 100755 --- a/manager.py +++ b/manager.py @@ -24,7 +24,7 @@ manager.add_command("db", MigrateCommand) def db_empty(): "Will drop every datas stocked in db." with application.app_context(): - web.models.db_empty(db) + newspipe.models.db_empty(db) @manager.command diff --git a/newspipe/bootstrap.py b/newspipe/bootstrap.py index 0d140fae..1fdb32e2 100644 --- a/newspipe/bootstrap.py +++ b/newspipe/bootstrap.py @@ -6,6 +6,7 @@ import os import logging from urllib.parse import urlsplit +from flask import request from flask_babel import Babel, format_datetime diff --git a/newspipe/lib/data.py b/newspipe/lib/data.py index b27b5d80..5e9457b7 100644 --- a/newspipe/lib/data.py +++ b/newspipe/lib/data.py @@ -32,6 +32,7 @@ __license__ = "AGPLv3" import json import opml +import logging import datetime from flask import jsonify @@ -41,6 +42,8 @@ from newspipe.models.tag import BookmarkTag from newspipe.controllers import BookmarkController, BookmarkTagController +logger = logging.getLogger(__name__) + def import_opml(nickname, opml_content): """ Import new feeds from an OPML file. diff --git a/newspipe/web/views/views.py b/newspipe/web/views/views.py index e3a5091f..346954e1 100644 --- a/newspipe/web/views/views.py +++ b/newspipe/web/views/views.py @@ -16,7 +16,7 @@ logger = logging.getLogger(__name__) @current_app.errorhandler(401) def authentication_required(error): - if API_ROOT in request.url: + if application.conf["API_ROOT"] in request.url: return error flash(gettext("Authentication required."), "info") return redirect(url_for("login")) -- cgit