From cf6f35ebd17dfa5874913360600b4a7065f7cb37 Mon Sep 17 00:00:00 2001 From: Changaco Date: Mon, 15 Dec 2014 15:24:15 +0100 Subject: [PATCH] actually, remove the entire function, we don't use it anymore --- gratipay/utils/__init__.py | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/gratipay/utils/__init__.py b/gratipay/utils/__init__.py index 5b246fb18c..0d6e7c7546 100644 --- a/gratipay/utils/__init__.py +++ b/gratipay/utils/__init__.py @@ -378,7 +378,6 @@ def update_global_stats(website): """, default=(0, 0.0)) website.gnactive = stats[0] website.gtransfer_volume = stats[1] - website.glast_week = last_week(website.db) nbackers = website.db.one(""" SELECT npatrons @@ -397,22 +396,6 @@ def update_global_stats(website): website.support_goal = goal -def last_week(db): - THURSDAY, FRIDAY, SATURDAY = 3, 4, 5 - now = datetime.utcnow() - payday = db.one("SELECT ts_start, ts_end FROM paydays WHERE ts_start > ts_end") - last_week = "last week" - if now.weekday() == THURSDAY: - if payday is not None and payday.ts_end is not None and payday.ts_end.year > 1970: - # Payday is finished for today. - last_week = "today" - elif now.weekday() == FRIDAY: - last_week = "yesterday" - elif now.weekday() == SATURDAY: - last_week = "this past week" - return last_week - - def _execute(this, sql, params=[]): print(sql.strip(), params) super(SimpleCursorBase, this).execute(sql, params)