Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
actually, remove the entire function, we don't use it anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco committed Dec 15, 2014
1 parent 47417d4 commit 8cc4361
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions gratipay/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit 8cc4361

Please sign in to comment.