Skip to content

Commit

Permalink
Tweak style in makemigrations utility
Browse files Browse the repository at this point in the history
  • Loading branch information
lskillen committed May 3, 2017
1 parent ea8e68f commit d6eaab6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions makemigrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d6eaab6

Please sign in to comment.