From f5a0a4e09b23ac0c12058732f401fdd384355269 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sat, 2 Mar 2019 12:19:47 +0100 Subject: [PATCH 1/3] migrate_schemas: PEP8ness, remove useless imports (#31042) --- .../multitenant/management/commands/migrate_schemas.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hobo/multitenant/management/commands/migrate_schemas.py b/hobo/multitenant/management/commands/migrate_schemas.py index 3fca67b..b1f58ed 100644 --- a/hobo/multitenant/management/commands/migrate_schemas.py +++ b/hobo/multitenant/management/commands/migrate_schemas.py @@ -1,5 +1,4 @@ import django -from optparse import NO_DEFAULT from django.apps import apps from django.core.management.commands.migrate import Command as MigrateCommand @@ -9,7 +8,7 @@ from django.db import connection from django.conf import settings from tenant_schemas.utils import get_public_schema_name, schema_exists -from hobo.multitenant.middleware import TenantMiddleware, TenantNotFound +from hobo.multitenant.middleware import TenantMiddleware from hobo.multitenant.management.commands import SyncCommon @@ -55,10 +54,9 @@ class MigrateSchemasCommand(SyncCommon): loader.load_disk() recorder = MigrationRecorder(connection) applied_public_migrations = set( - [(app, migration) for app, migration - in recorder.applied_migrations() - if app in app_labels and - (app, migration) in loader.disk_migrations]) + [(app, migration) + for app, migration in recorder.applied_migrations() + if app in app_labels and (app, migration) in loader.disk_migrations]) for tenant in TenantMiddleware.get_tenants(): connection.set_schema(tenant.schema_name, include_public=False) applied_migrations = self.get_applied_migrations(app_labels) -- 2.20.1