From d6eaab6e6cded232e5e5e3688e7e88642914eb1b Mon Sep 17 00:00:00 2001 From: Lee Skillen Date: Wed, 3 May 2017 15:25:54 +0100 Subject: [PATCH] Tweak style in makemigrations utility --- makemigrations.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/makemigrations.py b/makemigrations.py index 82d7a2af4b..bc9b52bdf1 100644 --- a/makemigrations.py +++ b/makemigrations.py @@ -62,16 +62,19 @@ def check_migrations(): for db in settings.DATABASES.keys(): try: executor = MigrationExecutor(connections[db]) - except OperationalError: - sys.exit("Unable to check migrations: " - "cannot connect to database.") + except OperationalError as ex: + sys.exit( + "Unable to check migrations due to database: {}".format(ex) + ) autodetector = MigrationAutodetector( executor.loader.project_state(), ProjectState.from_apps(apps), ) + changed.update( - autodetector.changes(graph=executor.loader.graph).keys()) + autodetector.changes(graph=executor.loader.graph).keys() + ) if changed and 'djstripe' in changed: sys.exit(