From 3c154d9beeae2a7a411cbaaae8797d1f0c2f063c Mon Sep 17 00:00:00 2001 From: Tim Laszlo Date: Mon, 15 Oct 2012 07:47:31 -0500 Subject: migrate_db: set the current interaction after import --- tools/upgrade/1.3/migrate_dbstats.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tools') diff --git a/tools/upgrade/1.3/migrate_dbstats.py b/tools/upgrade/1.3/migrate_dbstats.py index 3f3a02721..7a330cc99 100755 --- a/tools/upgrade/1.3/migrate_dbstats.py +++ b/tools/upgrade/1.3/migrate_dbstats.py @@ -258,6 +258,14 @@ def _restructure(): logger.info("Successfully restructured reason data") return True + logger.info("Updating recent interactions") + for newint in new_models.Interaction.objects.recent(): + try: + newint.save() + except: + logger.error("Failed to set current interaction %s for %s" % + (newint.id, newint.client.name), exc_info=1) + if __name__ == '__main__': Bcfg2.Logger.setup_logging('bcfg2-report-collector', -- cgit v1.2.3-1-g7c22