Permalink
Browse files

impr replicate tasks

  • Loading branch information...
1 parent e751e9d commit 2db855a6494d5028447153b7748c7085ec5986d7 eugene committed May 3, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 xml_generator/management/commands/replicatetasks.py
View
4 xml_generator/management/commands/replicatetasks.py
@@ -49,14 +49,14 @@ def handle(self, *args, **options):
repl_date += timedelta(days=task.period)
'''
- _dt = datetime.now().replace(tzinfo=utc)
+ #_dt = datetime.now().replace(tzinfo=utc)
#print 'today: ' + str(_dt.day)
_dt = datetime.now().replace(tzinfo=utc) - repl_date
# print 'diff: ' + str(_dt.days)
#print 'period: ' + str(task.period)
if _dt.days % task.period == 0:
try:
- existed_task = Task.objects.get(user=task.user, date_to_execute__day= datetime.now().replace(tzinfo=utc))
+ existed_task = Task.objects.get(user=task.user, date_to_execute__day= datetime.now().replace(tzinfo=utc).day)
print 'existed ' + existed_task.pk.__str__()
except:
new_task = Task(period = task.period, date_to_execute= datetime.now().replace(tzinfo=utc), user=task.user)

0 comments on commit 2db855a

Please sign in to comment.