--- a/app/soc/logic/models/base.py Mon May 25 23:45:20 2009 +0200
+++ b/app/soc/logic/models/base.py Tue May 26 00:19:09 2009 +0200
@@ -25,6 +25,8 @@
]
+import logging
+
from google.appengine.ext import db
from django.utils.translation import ugettext
@@ -324,7 +326,13 @@
query = self.getQueryForFields(filter=filter, order=order)
- result = query.fetch(limit, offset)
+ try:
+ result = query.fetch(limit, offset)
+ except db.NeedIndexError, exception:
+ result = []
+ logging.exception("%s, model: %s filter: %s, order: %s" %
+ (exception, self._model, filter, order))
+ # TODO: send email
if unique:
return result[0] if result else None