From 2acc49be40fd55eac35c23a20b36c685759a30d7 Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 4 Jul 2017 01:18:28 -0500 Subject: [PATCH] Tweak import placement to fix startup i.e. per Continuum needs --- rattail_tempmon/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rattail_tempmon/commands.py b/rattail_tempmon/commands.py index 5504630..1289ac5 100644 --- a/rattail_tempmon/commands.py +++ b/rattail_tempmon/commands.py @@ -32,8 +32,6 @@ import logging from rattail import commands from rattail.time import localtime, make_utc -from rattail_tempmon.db import Session as TempmonSession, model as tempmon - log = logging.getLogger(__name__) @@ -62,6 +60,8 @@ class PurgeTempmon(commands.Subcommand): "occur, but rollback (abort) the transaction at the end.") def run(self, args): + from rattail_tempmon.db import Session as TempmonSession, model as tempmon + cutoff = localtime(self.config).date() - datetime.timedelta(days=args.keep) cutoff = localtime(self.config, datetime.datetime.combine(cutoff, datetime.time(0))) session = TempmonSession()