[extensions-web] Fix cron job script once again



commit 92ca9e358b2b2da328bc74c00c8154bdf32ab73d
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Jan 30 12:03:08 2012 -0500

    Fix cron job script once again
    
    I'm a moron

 bin/sweettooth-cron-update |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/bin/sweettooth-cron-update b/bin/sweettooth-cron-update
index 6401005..52b2675 100755
--- a/bin/sweettooth-cron-update
+++ b/bin/sweettooth-cron-update
@@ -17,7 +17,6 @@ from extensions.models import Extension
 for ext in Extension.objects.all():
     data = (ext.popularity_items
             .filter(date__gt=(datetime.datetime.now()-datetime.timedelta(days=7)))
-            .annotate(popularity=Sum('offset')))
-    if 'popularity' in data:
-        ext.popularity = data['popularity']
-        ext.save()
+            .aggregate(popularity=Sum('offset')))
+    ext.popularity = data['popularity']
+    ext.save()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]