Fixing bug in dbupdate where it would explode on plugin that is missing MODELS or MIGRATIONS
The reason it blew up was because in the latter caught exception, it wouldn't set models/migrations to an empty set, so it would actually use the previous run's models/migrations! That's what we get for "leaky" variables on python for loops :) This commit sponsored by Pascal Diogo Antunes. Thank you!
This commit is contained in:
parent
ff97bbe944
commit
0ae3829048
@ -78,6 +78,7 @@ def gather_database_data(media_types, plugins):
|
|||||||
except AttributeError as exc:
|
except AttributeError as exc:
|
||||||
_log.warning('Could not find MODELS in {0}.models, have you \
|
_log.warning('Could not find MODELS in {0}.models, have you \
|
||||||
forgotten to add it? ({1})'.format(plugin, exc))
|
forgotten to add it? ({1})'.format(plugin, exc))
|
||||||
|
models = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
migrations = import_component('{0}.migrations:MIGRATIONS'.format(
|
migrations = import_component('{0}.migrations:MIGRATIONS'.format(
|
||||||
@ -91,6 +92,7 @@ forgotten to add it? ({1})'.format(plugin, exc))
|
|||||||
except AttributeError as exc:
|
except AttributeError as exc:
|
||||||
_log.debug('Cloud not find MIGRATIONS in {0}.migrations, have you \
|
_log.debug('Cloud not find MIGRATIONS in {0}.migrations, have you \
|
||||||
forgotten to add it? ({1})'.format(plugin, exc))
|
forgotten to add it? ({1})'.format(plugin, exc))
|
||||||
|
migrations = {}
|
||||||
|
|
||||||
if models:
|
if models:
|
||||||
managed_dbdata.append(
|
managed_dbdata.append(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user