aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2021-12-28 01:12:02 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2021-12-28 01:12:02 +0100
commit56b34db2bb402fd4b2991e271ec493f8bfb96420 (patch)
tree8938cff4a0af7593fec5dd884de5803a0eee226b
parentupdated SQLAlchemy (diff)
downloadnewspipe-56b34db2bb402fd4b2991e271ec493f8bfb96420.tar.gz
newspipe-56b34db2bb402fd4b2991e271ec493f8bfb96420.tar.bz2
newspipe-56b34db2bb402fd4b2991e271ec493f8bfb96420.zip
chg: [style] Format with black.
-rw-r--r--instance/config.py22
-rw-r--r--instance/sqlite.py22
-rw-r--r--migrations/env.py1
-rw-r--r--migrations/versions/2472eddbf44b_update_of_the_user_model.py5
-rw-r--r--newspipe/web/forms.py3
-rw-r--r--newspipe/web/views/bookmark.py4
6 files changed, 32 insertions, 25 deletions
diff --git a/instance/config.py b/instance/config.py
index 577c1659..eae58a53 100644
--- a/instance/config.py
+++ b/instance/config.py
@@ -28,19 +28,19 @@ SQLALCHEMY_DATABASE_URI = "postgresql://{user}:{password}@{host}:{port}/{name}".
# Security
CONTENT_SECURITY_POLICY = {
- 'default-src': '\'self\'',
- 'img-src': '*',
- 'media-src': [
- 'youtube.com',
+ "default-src": "'self'",
+ "img-src": "*",
+ "media-src": [
+ "youtube.com",
],
- 'script-src': [
- '\'self\'',
- '\'unsafe-inline\'',
+ "script-src": [
+ "'self'",
+ "'unsafe-inline'",
+ ],
+ "style-src": [
+ "'self'",
+ "'unsafe-inline'",
],
- 'style-src': [
- '\'self\'',
- '\'unsafe-inline\'',
- ]
}
# Crawler
CRAWLING_METHOD = "default"
diff --git a/instance/sqlite.py b/instance/sqlite.py
index 8c2b613c..9d171b89 100644
--- a/instance/sqlite.py
+++ b/instance/sqlite.py
@@ -19,19 +19,19 @@ SQLALCHEMY_DATABASE_URI = "sqlite:///newspipe.db"
# Security
CONTENT_SECURITY_POLICY = {
- 'default-src': '\'self\'',
- 'img-src': '* data:',
- 'media-src': [
- 'youtube.com',
+ "default-src": "'self'",
+ "img-src": "* data:",
+ "media-src": [
+ "youtube.com",
],
- 'script-src': [
- '\'self\'',
- '\'unsafe-inline\'',
+ "script-src": [
+ "'self'",
+ "'unsafe-inline'",
+ ],
+ "style-src": [
+ "'self'",
+ "'unsafe-inline'",
],
- 'style-src': [
- '\'self\'',
- '\'unsafe-inline\'',
- ]
}
# Crawler
diff --git a/migrations/env.py b/migrations/env.py
index e06cd8db..cbfe86d4 100644
--- a/migrations/env.py
+++ b/migrations/env.py
@@ -1,6 +1,7 @@
from __future__ import with_statement
from alembic import context
+
# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
diff --git a/migrations/versions/2472eddbf44b_update_of_the_user_model.py b/migrations/versions/2472eddbf44b_update_of_the_user_model.py
index 46d5b151..f89a9458 100644
--- a/migrations/versions/2472eddbf44b_update_of_the_user_model.py
+++ b/migrations/versions/2472eddbf44b_update_of_the_user_model.py
@@ -33,7 +33,10 @@ def downgrade():
sa.Column("id", sa.INTEGER(), nullable=False),
sa.Column("name", sa.VARCHAR(), nullable=True),
sa.Column("user_id", sa.INTEGER(), nullable=True),
- sa.ForeignKeyConstraint(["user_id"], ["user.id"],),
+ sa.ForeignKeyConstraint(
+ ["user_id"],
+ ["user.id"],
+ ),
sa.PrimaryKeyConstraint("id"),
sa.UniqueConstraint("name"),
)
diff --git a/newspipe/web/forms.py b/newspipe/web/forms.py
index 2aa28f07..3a492134 100644
--- a/newspipe/web/forms.py
+++ b/newspipe/web/forms.py
@@ -211,7 +211,8 @@ class ProfileForm(FlaskForm):
validated = False
if not 20 <= len(self.password.data) <= 500:
message = lazy_gettext(
- "Password must be between 20 and 500 characters.")
+ "Password must be between 20 and 500 characters."
+ )
self.password.errors.append(message)
validated = False
if self.nickname.data != User.make_valid_nickname(self.nickname.data):
diff --git a/newspipe/web/views/bookmark.py b/newspipe/web/views/bookmark.py
index ccb2cbe0..cb4b3a02 100644
--- a/newspipe/web/views/bookmark.py
+++ b/newspipe/web/views/bookmark.py
@@ -93,7 +93,9 @@ def list_(per_page, status="all"):
filters["shared"] = True
bookmarks = (
- BookmarkController(user_id).read_ordered(**filters).limit(1000)
+ BookmarkController(user_id)
+ .read_ordered(**filters)
+ .limit(1000)
# BookmarkController(user_id).read(**filters).limit(1000)
)
bgstack15