Do cleanup_deleted on migrate. Re-ordered active flag removal to be before system job template creation.

Also removed active flag deletes from remaining cleanup_deleted
management command as they will no longer be needed - but the
deletes of the authentication tokens as well as potentially disabled
users are still necessary, so the cleanup_deleted command will continue
to exist.

Reordering of the active flag removal to happen before the system job
template creation is necessary since the system job template creation
hits the license checker which at some point runs queries that depend on
the active flag, and with that code changing to not use the active flag,
we need to do the removal before we run this code.
This commit is contained in:
Akita Noek
2016-03-09 15:38:57 -05:00
parent ec59330465
commit 4825b2a6fc
6 changed files with 152 additions and 20 deletions

View File

@@ -111,8 +111,6 @@ class Command(BaseCommand):
n_deleted_items = 0
n_deleted_items += self.cleanup_model(User)
for model in self.get_models(PrimordialModel):
n_deleted_items += self.cleanup_model(model)
if not self.dry_run:
self.logger.log(99, "Removed %d items", n_deleted_items)