Browse Source

Bugfixes.

master
Ben Kurtovic 8 years ago
parent
commit
54387edb08
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      tif/calc.py

+ 2
- 2
tif/calc.py View File

@@ -111,7 +111,7 @@ def _format_time(cache_time):

def _get_protection(page):
edit = [prot for prot in page.protection if prot["type"] == "edit"]
return edit or None
return edit[0] if edit else None

def calculate_tif(title):
bot = Bot(".earwigbot")
@@ -131,5 +131,5 @@ def calculate_tif(title):
result["protection"] = _get_protection(page)
if cache_time:
result["cache_time"] = cache_time.strftime("%b %d, %Y %H:%M:%S UTC")
result["cache_ago"] = _format_time(cache_time)
result["cache_age"] = _format_time(cache_time)
return result

Loading…
Cancel
Save