From b5aa79f0641a0589f2a9e783035db2546561052f Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Sun, 2 Jan 2022 18:02:18 +0100 Subject: Resolved some flakes warnings. --- .../16f8fc3cf0cc_add_column_webpage_in_the_user_table.py | 5 ++--- .../versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py | 8 +++----- migrations/versions/19bdaa6208e_add_icon_column.py | 9 ++------- .../versions/1b750a389c22_remove_email_notification_column.py | 5 ++--- migrations/versions/2472eddbf44b_update_of_the_user_model.py | 5 ++--- .../versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py | 5 ++--- .../versions/2c5cc05216fa_adding_tag_handling_capacities.py | 5 ++--- .../3f83bfe93fc_add_updated_date_column_to_article_table.py | 5 ++--- migrations/versions/422da2d0234_adding_filters_field.py | 5 ++--- migrations/versions/48f561c0ce6_add_column_entry_id.py | 5 ++--- .../5553a6c05fa7_add_column_twitter_in_the_user_table.py | 5 ++--- .../versions/661199d8768a_problem_with_the_last_upgrade.py | 5 ++--- .../8bf5694c0b9e_add_column_automatic_crawling_to_the_.py | 5 ++--- .../957d4c5b8ac9_add_column_is_public_profile_to_the_.py | 5 ++--- .../ac35c979311a_removed_activation_key_from_the_user_.py | 5 ++--- .../b329a1a7366f_add_new_tables_for_the_bookmarks_and_.py | 8 +++----- .../versions/bdd38bd755cb_remove_email_attribute_from_users_.py | 5 ++--- .../be2b8b6f33dd_add_column_private_to_the_feeds_table.py | 5 ++--- .../versions/cde34831ea_adding_feed_and_user_attributes_for_.py | 7 +++---- .../f700c4237e9d_remove_refresh_rate_column_from_the_.py | 5 ++--- migrations/versions/fa10b0bdd045_add_bio_column_to_user_table.py | 5 ++--- newspipe/lib/utils.py | 2 +- newspipe/models/user.py | 6 +++--- newspipe/web/forms.py | 2 +- 24 files changed, 50 insertions(+), 77 deletions(-) diff --git a/migrations/versions/16f8fc3cf0cc_add_column_webpage_in_the_user_table.py b/migrations/versions/16f8fc3cf0cc_add_column_webpage_in_the_user_table.py index c44e778f..7842083a 100644 --- a/migrations/versions/16f8fc3cf0cc_add_column_webpage_in_the_user_table.py +++ b/migrations/versions/16f8fc3cf0cc_add_column_webpage_in_the_user_table.py @@ -7,14 +7,13 @@ Create Date: 2016-09-21 08:00:27.160357 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "16f8fc3cf0cc" down_revision = "957d4c5b8ac9" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.add_column("user", sa.Column("webpage", sa.String(), default="")) diff --git a/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py b/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py index 7aea3040..f94d85ce 100644 --- a/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py +++ b/migrations/versions/17dcb75f3fe_changed_the_type_of_the_column_last_.py @@ -7,14 +7,12 @@ Create Date: 2015-03-10 14:20:53.676344 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa +from datetime import datetime revision = "17dcb75f3fe" down_revision = "cde34831ea" -from datetime import datetime - -import sqlalchemy as sa -from alembic import op - def upgrade(): unix_start = datetime(1970, 1, 1) diff --git a/migrations/versions/19bdaa6208e_add_icon_column.py b/migrations/versions/19bdaa6208e_add_icon_column.py index 45e3dcc2..a7542f5d 100644 --- a/migrations/versions/19bdaa6208e_add_icon_column.py +++ b/migrations/versions/19bdaa6208e_add_icon_column.py @@ -7,20 +7,15 @@ Create Date: 2015-07-03 12:09:58.596010 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "19bdaa6208e" down_revision = "422da2d0234" -import sqlalchemy as sa -from alembic import op - def upgrade(): - ### commands auto generated by Alembic - please adjust! ### op.add_column("feed", sa.Column("icon", sa.String(), nullable=True)) - ### end Alembic commands ### def downgrade(): - ### commands auto generated by Alembic - please adjust! ### op.drop_column("feed", "icon") - ### end Alembic commands ### diff --git a/migrations/versions/1b750a389c22_remove_email_notification_column.py b/migrations/versions/1b750a389c22_remove_email_notification_column.py index fd1d3a01..f019faa9 100644 --- a/migrations/versions/1b750a389c22_remove_email_notification_column.py +++ b/migrations/versions/1b750a389c22_remove_email_notification_column.py @@ -7,12 +7,11 @@ Create Date: 2015-02-25 23:01:07.253429 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "1b750a389c22" down_revision = "48f561c0ce6" -import sqlalchemy as sa -from alembic import op - def upgrade(): if "sqlite" not in "SQLALCHEMY_DATABASE_URI": diff --git a/migrations/versions/2472eddbf44b_update_of_the_user_model.py b/migrations/versions/2472eddbf44b_update_of_the_user_model.py index f89a9458..61bd10d2 100644 --- a/migrations/versions/2472eddbf44b_update_of_the_user_model.py +++ b/migrations/versions/2472eddbf44b_update_of_the_user_model.py @@ -7,14 +7,13 @@ Create Date: 2016-03-01 22:35:03.659694 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "2472eddbf44b" down_revision = "ac35c979311a" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.drop_column("user", "enabled") diff --git a/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py b/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py index 0712dcb2..cc58a026 100644 --- a/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py +++ b/migrations/versions/25ca960a207_mv_icons_from_feed_tbl_to_icon_tbl.py @@ -7,12 +7,11 @@ Create Date: 2015-08-03 14:36:21.626411 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "25ca960a207" down_revision = "19bdaa6208e" -import sqlalchemy as sa -from alembic import op - def upgrade(): op.create_table( diff --git a/migrations/versions/2c5cc05216fa_adding_tag_handling_capacities.py b/migrations/versions/2c5cc05216fa_adding_tag_handling_capacities.py index 02d16918..2f06cd2b 100644 --- a/migrations/versions/2c5cc05216fa_adding_tag_handling_capacities.py +++ b/migrations/versions/2c5cc05216fa_adding_tag_handling_capacities.py @@ -7,14 +7,13 @@ Create Date: 2016-11-08 07:41:13.923531 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "2c5cc05216fa" down_revision = "be2b8b6f33dd" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.create_table( diff --git a/migrations/versions/3f83bfe93fc_add_updated_date_column_to_article_table.py b/migrations/versions/3f83bfe93fc_add_updated_date_column_to_article_table.py index 3b49829b..3fd624cf 100644 --- a/migrations/versions/3f83bfe93fc_add_updated_date_column_to_article_table.py +++ b/migrations/versions/3f83bfe93fc_add_updated_date_column_to_article_table.py @@ -7,12 +7,11 @@ Create Date: 2016-02-12 21:51:40.868539 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "3f83bfe93fc" down_revision = "25ca960a207" -import sqlalchemy as sa -from alembic import op - def upgrade(): op.add_column("article", sa.Column("updated_date", sa.DateTime(), nullable=True)) diff --git a/migrations/versions/422da2d0234_adding_filters_field.py b/migrations/versions/422da2d0234_adding_filters_field.py index 30c6b0b2..2d175d4b 100644 --- a/migrations/versions/422da2d0234_adding_filters_field.py +++ b/migrations/versions/422da2d0234_adding_filters_field.py @@ -7,12 +7,11 @@ Create Date: 2015-05-18 23:03:15.809549 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "422da2d0234" down_revision = "17dcb75f3fe" -import sqlalchemy as sa -from alembic import op - def upgrade(): op.add_column("feed", sa.Column("filters", sa.PickleType(), nullable=True)) diff --git a/migrations/versions/48f561c0ce6_add_column_entry_id.py b/migrations/versions/48f561c0ce6_add_column_entry_id.py index ad05313f..2a9a1590 100644 --- a/migrations/versions/48f561c0ce6_add_column_entry_id.py +++ b/migrations/versions/48f561c0ce6_add_column_entry_id.py @@ -7,14 +7,13 @@ Create Date: 2015-02-18 21:17:19.346998 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "48f561c0ce6" down_revision = None branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.add_column("article", sa.Column("entry_id", sa.String(), nullable=True)) diff --git a/migrations/versions/5553a6c05fa7_add_column_twitter_in_the_user_table.py b/migrations/versions/5553a6c05fa7_add_column_twitter_in_the_user_table.py index d40477f1..2ca80a11 100644 --- a/migrations/versions/5553a6c05fa7_add_column_twitter_in_the_user_table.py +++ b/migrations/versions/5553a6c05fa7_add_column_twitter_in_the_user_table.py @@ -7,14 +7,13 @@ Create Date: 2016-10-06 11:02:41.356322 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "5553a6c05fa7" down_revision = "f700c4237e9d" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.add_column("user", sa.Column("twitter", sa.String(), default="")) diff --git a/migrations/versions/661199d8768a_problem_with_the_last_upgrade.py b/migrations/versions/661199d8768a_problem_with_the_last_upgrade.py index 04a5ac87..6c1fcc9b 100644 --- a/migrations/versions/661199d8768a_problem_with_the_last_upgrade.py +++ b/migrations/versions/661199d8768a_problem_with_the_last_upgrade.py @@ -7,14 +7,13 @@ Create Date: 2016-02-13 11:33:14.183576 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "661199d8768a" down_revision = "3f83bfe93fc" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.add_column("article", sa.Column("updated_date", sa.DateTime(), nullable=True)) diff --git a/migrations/versions/8bf5694c0b9e_add_column_automatic_crawling_to_the_.py b/migrations/versions/8bf5694c0b9e_add_column_automatic_crawling_to_the_.py index 011da048..c2262dec 100644 --- a/migrations/versions/8bf5694c0b9e_add_column_automatic_crawling_to_the_.py +++ b/migrations/versions/8bf5694c0b9e_add_column_automatic_crawling_to_the_.py @@ -7,14 +7,13 @@ Create Date: 2016-10-06 13:47:32.784711 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "8bf5694c0b9e" down_revision = "5553a6c05fa7" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.add_column("user", sa.Column("automatic_crawling", sa.Boolean(), default=True)) diff --git a/migrations/versions/957d4c5b8ac9_add_column_is_public_profile_to_the_.py b/migrations/versions/957d4c5b8ac9_add_column_is_public_profile_to_the_.py index 86171fa8..c988d0b0 100644 --- a/migrations/versions/957d4c5b8ac9_add_column_is_public_profile_to_the_.py +++ b/migrations/versions/957d4c5b8ac9_add_column_is_public_profile_to_the_.py @@ -7,14 +7,13 @@ Create Date: 2016-09-20 14:35:31.302555 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "957d4c5b8ac9" down_revision = "2472eddbf44b" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.add_column("user", sa.Column("is_public_profile", sa.Boolean(), default=False)) diff --git a/migrations/versions/ac35c979311a_removed_activation_key_from_the_user_.py b/migrations/versions/ac35c979311a_removed_activation_key_from_the_user_.py index 85f80247..f272598e 100644 --- a/migrations/versions/ac35c979311a_removed_activation_key_from_the_user_.py +++ b/migrations/versions/ac35c979311a_removed_activation_key_from_the_user_.py @@ -7,14 +7,13 @@ Create Date: 2016-02-18 08:54:43.786641 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "ac35c979311a" down_revision = "661199d8768a" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.drop_column("user", "activation_key") diff --git a/migrations/versions/b329a1a7366f_add_new_tables_for_the_bookmarks_and_.py b/migrations/versions/b329a1a7366f_add_new_tables_for_the_bookmarks_and_.py index 2104e1ad..2ddb8f9f 100644 --- a/migrations/versions/b329a1a7366f_add_new_tables_for_the_bookmarks_and_.py +++ b/migrations/versions/b329a1a7366f_add_new_tables_for_the_bookmarks_and_.py @@ -7,16 +7,14 @@ Create Date: 2017-05-23 21:42:37.636307 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa +from datetime import datetime revision = "b329a1a7366f" down_revision = "2c5cc05216fa" branch_labels = None depends_on = None -from datetime import datetime - -import sqlalchemy as sa -from alembic import op - def upgrade(): op.drop_table("tag") diff --git a/migrations/versions/bdd38bd755cb_remove_email_attribute_from_users_.py b/migrations/versions/bdd38bd755cb_remove_email_attribute_from_users_.py index 793e4683..82792546 100644 --- a/migrations/versions/bdd38bd755cb_remove_email_attribute_from_users_.py +++ b/migrations/versions/bdd38bd755cb_remove_email_attribute_from_users_.py @@ -7,14 +7,13 @@ Create Date: 2018-04-04 23:26:52.517804 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "bdd38bd755cb" down_revision = "b329a1a7366f" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.drop_column("user", "email") diff --git a/migrations/versions/be2b8b6f33dd_add_column_private_to_the_feeds_table.py b/migrations/versions/be2b8b6f33dd_add_column_private_to_the_feeds_table.py index 139b5e0e..bac2fd5c 100644 --- a/migrations/versions/be2b8b6f33dd_add_column_private_to_the_feeds_table.py +++ b/migrations/versions/be2b8b6f33dd_add_column_private_to_the_feeds_table.py @@ -7,14 +7,13 @@ Create Date: 2016-10-24 13:28:55.964803 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "be2b8b6f33dd" down_revision = "fa10b0bdd045" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.add_column("feed", sa.Column("private", sa.Boolean(), default=False)) diff --git a/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py b/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py index 53607f76..c0a58503 100644 --- a/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py +++ b/migrations/versions/cde34831ea_adding_feed_and_user_attributes_for_.py @@ -7,12 +7,11 @@ Create Date: 2015-03-04 22:59:44.665979 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa +from datetime import datetime revision = "cde34831ea" down_revision = "1b750a389c22" -from datetime import datetime - -import sqlalchemy as sa -from alembic import op def upgrade(): diff --git a/migrations/versions/f700c4237e9d_remove_refresh_rate_column_from_the_.py b/migrations/versions/f700c4237e9d_remove_refresh_rate_column_from_the_.py index 3ed8c5f9..83175034 100644 --- a/migrations/versions/f700c4237e9d_remove_refresh_rate_column_from_the_.py +++ b/migrations/versions/f700c4237e9d_remove_refresh_rate_column_from_the_.py @@ -7,14 +7,13 @@ Create Date: 2016-10-05 08:47:51.384069 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "f700c4237e9d" down_revision = "16f8fc3cf0cc" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.drop_column("user", "refresh_rate") diff --git a/migrations/versions/fa10b0bdd045_add_bio_column_to_user_table.py b/migrations/versions/fa10b0bdd045_add_bio_column_to_user_table.py index 893138d5..de5939ed 100644 --- a/migrations/versions/fa10b0bdd045_add_bio_column_to_user_table.py +++ b/migrations/versions/fa10b0bdd045_add_bio_column_to_user_table.py @@ -7,14 +7,13 @@ Create Date: 2016-10-07 10:43:04.428178 """ # revision identifiers, used by Alembic. +from alembic import op +import sqlalchemy as sa revision = "fa10b0bdd045" down_revision = "8bf5694c0b9e" branch_labels = None depends_on = None -import sqlalchemy as sa -from alembic import op - def upgrade(): op.add_column("user", sa.Column("bio", sa.String(5000), default="")) diff --git a/newspipe/lib/utils.py b/newspipe/lib/utils.py index 7e6f3cf4..beef75ac 100644 --- a/newspipe/lib/utils.py +++ b/newspipe/lib/utils.py @@ -82,7 +82,7 @@ def clear_string(data): and consecutive white spaces (more that one). """ p = re.compile("<[^>]+>") # HTML tags - q = re.compile("\s") # consecutive white spaces + q = re.compile(r"\s") # consecutive white spaces return p.sub("", q.sub(" ", data)) diff --git a/newspipe/models/user.py b/newspipe/models/user.py index c119e1b0..158da03e 100644 --- a/newspipe/models/user.py +++ b/newspipe/models/user.py @@ -20,9 +20,9 @@ # along with this program. If not, see . __author__ = "Cedric Bonhomme" -__version__ = "$Revision: 0.4 $" +__version__ = "$Revision: 0.5 $" __date__ = "$Date: 2013/11/05 $" -__revision__ = "$Date: 2014/04/12 $" +__revision__ = "$Date: 2022/01/02 $" __copyright__ = "Copyright (c) Cedric Bonhomme" __license__ = "GPLv3" @@ -94,7 +94,7 @@ class User(db.Model, UserMixin, RightMixin): @staticmethod def make_valid_nickname(nickname): - return re.sub("[^a-zA-Z0-9_\.]", "", nickname) + return re.sub("[^a-zA-Z0-9_-]", "", nickname) @validates("bio") def validates_bio(self, key, value): diff --git a/newspipe/web/forms.py b/newspipe/web/forms.py index c73d58fa..7dd21161 100644 --- a/newspipe/web/forms.py +++ b/newspipe/web/forms.py @@ -87,7 +87,7 @@ class SignupForm(FlaskForm): self.nickname.errors.append( lazy_gettext( "This nickname has invalid characters. " - "Please use letters, numbers, dots and underscores only." + "Please use letters, numbers, dash and underscores only." ) ) validated = False -- cgit