From cf3c4f1ba679cea8c58f8e80b5ee5f59bda0a454 Mon Sep 17 00:00:00 2001 From: rembo10 Date: Wed, 31 Oct 2012 19:22:23 -0400 Subject: [PATCH] Fix for helpers.get_age failing if there's no date --- headphones/helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/headphones/helpers.py b/headphones/helpers.py index 2b80f93b..e68abdd6 100644 --- a/headphones/helpers.py +++ b/headphones/helpers.py @@ -120,7 +120,10 @@ def now(): def get_age(date): - split_date = date.split('-') + try: + split_date = date.split('-') + except: + return False try: days_old = int(split_date[0])*365 + int(split_date[1])*30 + int(split_date[2])