Commits

Miki Tebeka  committed dc8dda1

Catch NeedIndexError

  • Participants
  • Parent commits 03a0364
  • Branches user-urls

Comments (0)

Files changed (1)

 
 def user_urls(user, max=100):
     '''Last 100 urls for user.'''
-    return Url.all().filter('user =' , user).order('-created').fetch(max)
+    try:
+        return Url.all().filter('user =' , user).order('-created').fetch(max)
+    except db.NeedIndexError:
+        log.error('Not indexed yet')
+        return []
 
 def fix_url(url):
     '''Fix url by appending http:// if needed.