Commits

Waldemar Kornewald committed 7f69f3d

added request exception logging and fixed potential bug with pk='' queries

Comments (0)

Files changed (2)

                                         "the primary key.")
                     if not isinstance(value, (tuple, list)):
                         value = [value]
-                    pk_filters = [create_key(db_table, pk) for pk in value]
+                    pk_filters = [create_key(db_table, pk) for pk in value if pk]
                     continue
                 else:
                     # XXX: set db_type to 'gae_key' in order to allow
 from google.appengine.ext.webapp import util
 from django.conf import settings
 
+def log_traceback(*args, **kwargs):
+    import logging
+    logging.exception('Exception in request:')
+
+from django.core import signals
+signals.got_request_exception.connect(log_traceback)
+
 def real_main():
     # Reset path and environment variables
     global path_backup