Skip to content

Commit

Permalink
Update e866bd2d4976_smaller_grid.py
Browse files Browse the repository at this point in the history
  • Loading branch information
timifasubaa committed Feb 22, 2018
1 parent 67be212 commit e9d0db7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions superset/migrations/versions/e866bd2d4976_smaller_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ def upgrade():
session = db.Session(bind=bind)

dashboards = session.query(Dashboard).all()
print('Upgrading ({}/{}): {}'.format(
i, len(dashboards), dashboard.id))
for i, dashboard in enumerate(dashboards):
print('Upgrading ({}/{}): {}'.format(
i, len(dashboards), dashboard.id))
positions = json.loads(dashboard.position_json or '{}')
for pos in positions:
if type(pos) == dict and pos.get('v', 0) == 0:
if pos.get('v', 0) == 0:
pos['size_x'] = pos['size_x'] * RATIO
pos['size_y'] = pos['size_y'] * RATIO
pos['col'] = ((pos['col'] - 1) * RATIO) + 1
Expand All @@ -55,9 +55,9 @@ def downgrade():
session = db.Session(bind=bind)

dashboards = session.query(Dashboard).all()
print('Downgrading ({}/{}): {}'.format(
i, len(dashboards), dashboard.id))
for i, dashboard in enumerate(dashboards):
print('Downgrading ({}/{}): {}'.format(
i, len(dashboards), dashboard.id))
positions = json.loads(dashboard.position_json or '{}')
for pos in positions:
if pos.get('v', 0) == 1:
Expand Down

0 comments on commit e9d0db7

Please sign in to comment.