Skip to content

Commit 22a65f3

Browse files
authored
Compatibility fixes for Flask 2.0 and SQLAlchemy 1.4 (#71)
1 parent a5471e8 commit 22a65f3

10 files changed

+21
-42
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ baseframe-packed.js
2323
packed.css
2424
packed.js
2525
error.log
26+
error.log.*
2627
*.sql
2728
*.gz
2829
*.bz2

.pre-commit-config.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ repos:
1414
'--remove-duplicate-keys',
1515
]
1616
- repo: https://github.com/pre-commit/mirrors-isort
17-
rev: v4.3.21
17+
rev: v5.8.0
1818
hooks:
1919
- id: isort
2020
additional_dependencies:
2121
- toml
2222
- repo: https://github.com/ambv/black
23-
rev: 19.10b0
23+
rev: 21.5b2
2424
hooks:
2525
- id: black
2626
- repo: https://github.com/pre-commit/pre-commit-hooks
27-
rev: v3.1.0
27+
rev: v4.0.1
2828
hooks:
2929
- id: check-added-large-files
3030
- id: check-ast
@@ -51,7 +51,7 @@ repos:
5151
- id: requirements-txt-fixer
5252
- id: trailing-whitespace
5353
- repo: https://gitlab.com/pycqa/flake8
54-
rev: 3.8.2
54+
rev: 3.9.2
5555
hooks:
5656
- id: flake8
5757
additional_dependencies:
@@ -66,13 +66,13 @@ repos:
6666
- flake8-print
6767
- pep8-naming
6868
- repo: https://github.com/PyCQA/bandit
69-
rev: 1.6.2
69+
rev: 1.7.0
7070
hooks:
7171
- id: bandit
7272
language_version: python3
7373
exclude: (^tests|funnel/loginproviders/flask_oauth.py)
74-
- repo: https://github.com/prettier/prettier
75-
rev: 2.0.5
74+
- repo: https://github.com/pre-commit/mirrors-prettier
75+
rev: v2.3.1
7676
hooks:
7777
- id: prettier
7878
args: ['--single-quote', '--trailing-comma', 'es5']

instance/testing.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#: Asset server
1414
ASSET_SERVER = 'https://static.hasgeek.co.in/'
1515
#: Secret key
16-
SECRET_KEY = 'make this something random'
16+
SECRET_KEY = 'make this something random' # nosec
1717
#: Cache type
1818
CACHE_TYPE = 'redis'
1919
#: Timezone
@@ -23,7 +23,7 @@
2323
#: Lastuser client id
2424
LASTUSER_CLIENT_ID = ''
2525
#: Lastuser client secret
26-
LASTUSER_CLIENT_SECRET = ''
26+
LASTUSER_CLIENT_SECRET = '' # nosec
2727
#: Mail settings
2828
#: MAIL_FAIL_SILENTLY : default True
2929
#: MAIL_SERVER : default 'localhost'

manage.py

-17
This file was deleted.

migrations/script.py.mako

100755100644
File mode changed.

migrations/versions/32de3aa6b4f4_link_tracking.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ def upgrade():
3232
sa.Column('updated_at', sa.DateTime(), nullable=False),
3333
sa.Column('link_id', sa.Integer(), nullable=False),
3434
sa.Column('recipient_id', sa.Integer(), nullable=False),
35-
sa.ForeignKeyConstraint(['link_id'], ['email_link.id'],),
36-
sa.ForeignKeyConstraint(['recipient_id'], ['email_recipient.id'],),
35+
sa.ForeignKeyConstraint(['link_id'], ['email_link.id']),
36+
sa.ForeignKeyConstraint(['recipient_id'], ['email_recipient.id']),
3737
sa.PrimaryKeyConstraint('link_id', 'recipient_id'),
3838
)
3939

migrations/versions/37330aca0db9_init.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def upgrade():
4848
sa.Column('trackclicks', sa.Boolean(), nullable=False),
4949
sa.Column('name', sa.Unicode(length=250), nullable=False),
5050
sa.Column('title', sa.Unicode(length=250), nullable=False),
51-
sa.ForeignKeyConstraint(['user_id'], ['user.id'],),
51+
sa.ForeignKeyConstraint(['user_id'], ['user.id']),
5252
sa.PrimaryKeyConstraint('id'),
5353
sa.UniqueConstraint('name'),
5454
)
@@ -62,7 +62,7 @@ def upgrade():
6262
sa.Column('template_text', sa.UnicodeText(), nullable=False),
6363
sa.Column('template_html', sa.UnicodeText(), nullable=False),
6464
sa.Column('url_id', sa.Integer(), nullable=False),
65-
sa.ForeignKeyConstraint(['campaign_id'], ['email_campaign.id'],),
65+
sa.ForeignKeyConstraint(['campaign_id'], ['email_campaign.id']),
6666
sa.PrimaryKeyConstraint('id'),
6767
sa.UniqueConstraint('campaign_id', 'url_id'),
6868
)
@@ -90,8 +90,8 @@ def upgrade():
9090
sa.Column('draft_id', sa.Integer(), nullable=True),
9191
sa.Column('linkgroup', sa.Integer(), nullable=True),
9292
sa.Column('url_id', sa.Integer(), nullable=False),
93-
sa.ForeignKeyConstraint(['campaign_id'], ['email_campaign.id'],),
94-
sa.ForeignKeyConstraint(['draft_id'], ['email_draft.id'],),
93+
sa.ForeignKeyConstraint(['campaign_id'], ['email_campaign.id']),
94+
sa.ForeignKeyConstraint(['draft_id'], ['email_draft.id']),
9595
sa.PrimaryKeyConstraint('id'),
9696
sa.UniqueConstraint('campaign_id', 'url_id'),
9797
sa.UniqueConstraint('opentoken'),

runserver.py

-10
This file was deleted.

runserver.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
export FLASK_ENV=development
3+
export FLASK_RUN_HOST=0.0.0.0
4+
export FLASK_RUN_PORT=7890
5+
flask run

website.py wsgi.py

File renamed without changes.

0 commit comments

Comments
 (0)