aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2023-06-24 00:28:03 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2023-06-24 00:28:03 +0200
commiteccd193ebc875293d5303e1a21445555bdc40daa (patch)
tree5c29cbae9613405361368f5a343df2964d9b6e3b
parentApplied patch from "B. Stack" <bgstack15@gmail.com> (diff)
downloadnewspipe-eccd193ebc875293d5303e1a21445555bdc40daa.tar.gz
newspipe-eccd193ebc875293d5303e1a21445555bdc40daa.tar.bz2
newspipe-eccd193ebc875293d5303e1a21445555bdc40daa.zip
Addresses some flake8 warnings.
-rwxr-xr-xnewspipe/commands.py5
-rw-r--r--newspipe/controllers/article.py2
-rw-r--r--newspipe/controllers/feed.py1
-rw-r--r--newspipe/lib/feed_utils.py1
-rw-r--r--newspipe/models/article.py2
-rw-r--r--newspipe/web/views/feed.py1
-rw-r--r--newspipe/web/views/session_mgmt.py8
7 files changed, 12 insertions, 8 deletions
diff --git a/newspipe/commands.py b/newspipe/commands.py
index c7aeb96c..f5128148 100755
--- a/newspipe/commands.py
+++ b/newspipe/commands.py
@@ -4,8 +4,6 @@ from datetime import date
from datetime import datetime
import click
-from sqlalchemy import text
-from sqlalchemy import create_engine
from dateutil.relativedelta import relativedelta
from werkzeug.security import generate_password_hash
@@ -15,6 +13,9 @@ from newspipe.bootstrap import db
from newspipe.controllers import ArticleController
from newspipe.controllers import UserController
+# from sqlalchemy import create_engine
+# from sqlalchemy import text
+
logger = logging.getLogger("commands")
diff --git a/newspipe/controllers/article.py b/newspipe/controllers/article.py
index d5ded05a..f82ca559 100644
--- a/newspipe/controllers/article.py
+++ b/newspipe/controllers/article.py
@@ -66,7 +66,7 @@ class ArticleController(AbstractController):
try:
cat = CategoryController().get(id=attrs["category_id"])
assert self.user_id is None or cat.user_id == user_id, (
- "no right on cat %r" % cat.id
+ "no right on cat %r" % cat.id
)
except Exception:
pass
diff --git a/newspipe/controllers/feed.py b/newspipe/controllers/feed.py
index b8856966..9461a798 100644
--- a/newspipe/controllers/feed.py
+++ b/newspipe/controllers/feed.py
@@ -95,6 +95,7 @@ class FeedController(AbstractController):
def update(self, filters, attrs):
from .article import ArticleController
+
self._ensure_icon(attrs)
# if "category_id" in attrs and attrs["category_id"] == 0:
# del attrs["category_id"]
diff --git a/newspipe/lib/feed_utils.py b/newspipe/lib/feed_utils.py
index 15b3076c..a404d5fa 100644
--- a/newspipe/lib/feed_utils.py
+++ b/newspipe/lib/feed_utils.py
@@ -120,7 +120,6 @@ def construct_feed_from(url=None, fp_parsed=None, feed=None, query_site=True):
return wrapper
if not feed.get("icon_url"):
-
icons = bs_parsed.find_all(check_keys(rel=["icon", "shortcut"]))
if not len(icons):
icons = bs_parsed.find_all(check_keys(rel=["icon"]))
diff --git a/newspipe/models/article.py b/newspipe/models/article.py
index 9f451af5..ae7e2b11 100644
--- a/newspipe/models/article.py
+++ b/newspipe/models/article.py
@@ -26,7 +26,7 @@ __license__ = "GPLv3"
from datetime import datetime
-from sqlalchemy import Index, ForeignKeyConstraint
+# from sqlalchemy import Index, ForeignKeyConstraint
from sqlalchemy.ext.associationproxy import association_proxy
from newspipe.bootstrap import db
diff --git a/newspipe/web/views/feed.py b/newspipe/web/views/feed.py
index 16059319..9499ba01 100644
--- a/newspipe/web/views/feed.py
+++ b/newspipe/web/views/feed.py
@@ -234,7 +234,6 @@ def form(feed_id=None):
@feed_bp.route("/edit/<int:feed_id>", methods=["POST"])
@login_required
def process_form(feed_id=None):
-
form = AddFeedForm()
feed_contr = FeedController(current_user.id)
form.set_category_choices(CategoryController(current_user.id).read())
diff --git a/newspipe/web/views/session_mgmt.py b/newspipe/web/views/session_mgmt.py
index 0154503a..5da74720 100644
--- a/newspipe/web/views/session_mgmt.py
+++ b/newspipe/web/views/session_mgmt.py
@@ -4,8 +4,8 @@ from datetime import datetime
from flask import current_app
from flask import flash
from flask import redirect
-from flask import request
from flask import render_template
+from flask import request
from flask import session
from flask import url_for
from flask_babel import gettext
@@ -84,7 +84,11 @@ def login():
if request.method == "POST" and form.validate(): # fixes an issue in flask-wtf
login_user_bundle(form.user)
return form.redirect("home")
- return render_template("login.html", form=form, self_registration=application.config["SELF_REGISTRATION"])
+ return render_template(
+ "login.html",
+ form=form,
+ self_registration=application.config["SELF_REGISTRATION"],
+ )
@current_app.route("/logout")
bgstack15