aboutsummaryrefslogtreecommitdiff
path: root/ihatemoney/migrations/versions/b78f8a8bdb16_hash_project_passwords.py
diff options
context:
space:
mode:
authorAlexis M <alexis@notmyidea.org>2019-10-11 20:20:13 +0200
committerAlexis Metaireau <alexis@notmyidea.org>2019-10-14 21:20:38 +0200
commitf260a2c9e7b2f34d49ef4c2e50ce83a2361cf343 (patch)
treededf02275cb089fb2d954a668de6f8eff794036a /ihatemoney/migrations/versions/b78f8a8bdb16_hash_project_passwords.py
parentf2a0b9f3f0e24617f698ce74943cdabdea01431e (diff)
downloadihatemoney-mirror-f260a2c9e7b2f34d49ef4c2e50ce83a2361cf343.zip
ihatemoney-mirror-f260a2c9e7b2f34d49ef4c2e50ce83a2361cf343.tar.gz
ihatemoney-mirror-f260a2c9e7b2f34d49ef4c2e50ce83a2361cf343.tar.bz2
Use black to refomat the files.
Diffstat (limited to 'ihatemoney/migrations/versions/b78f8a8bdb16_hash_project_passwords.py')
-rw-r--r--ihatemoney/migrations/versions/b78f8a8bdb16_hash_project_passwords.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/ihatemoney/migrations/versions/b78f8a8bdb16_hash_project_passwords.py b/ihatemoney/migrations/versions/b78f8a8bdb16_hash_project_passwords.py
index e32983d..e730b8d 100644
--- a/ihatemoney/migrations/versions/b78f8a8bdb16_hash_project_passwords.py
+++ b/ihatemoney/migrations/versions/b78f8a8bdb16_hash_project_passwords.py
@@ -7,20 +7,21 @@ Create Date: 2017-12-17 11:45:44.783238
"""
# revision identifiers, used by Alembic.
-revision = 'b78f8a8bdb16'
-down_revision = 'f629c8ef4ab0'
+revision = "b78f8a8bdb16"
+down_revision = "f629c8ef4ab0"
from alembic import op
import sqlalchemy as sa
from werkzeug.security import generate_password_hash
project_helper = sa.Table(
- 'project', sa.MetaData(),
- sa.Column('id', sa.String(length=64), nullable=False),
- sa.Column('name', sa.UnicodeText(), nullable=True),
- sa.Column('password', sa.String(length=128), nullable=True),
- sa.Column('contact_email', sa.String(length=128), nullable=True),
- sa.PrimaryKeyConstraint('id')
+ "project",
+ sa.MetaData(),
+ sa.Column("id", sa.String(length=64), nullable=False),
+ sa.Column("name", sa.UnicodeText(), nullable=True),
+ sa.Column("password", sa.String(length=128), nullable=True),
+ sa.Column("contact_email", sa.String(length=128), nullable=True),
+ sa.PrimaryKeyConstraint("id"),
)
@@ -28,11 +29,9 @@ def upgrade():
connection = op.get_bind()
for project in connection.execute(project_helper.select()):
connection.execute(
- project_helper.update().where(
- project_helper.c.name == project.name
- ).values(
- password=generate_password_hash(project.password)
- )
+ project_helper.update()
+ .where(project_helper.c.name == project.name)
+ .values(password=generate_password_hash(project.password))
)