From 0ae036bccd317aa8f364f8fa68b7e95e2eb5303d Mon Sep 17 00:00:00 2001 From: Diane Trout Date: Thu, 28 Jan 2010 19:49:13 +0000 Subject: [PATCH] Force auth_backend error messages to sys stderr, as wsgi hates stdout --- htsworkflow/frontend/samples/auth_backend.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htsworkflow/frontend/samples/auth_backend.py b/htsworkflow/frontend/samples/auth_backend.py index c4960b9..e09d404 100644 --- a/htsworkflow/frontend/samples/auth_backend.py +++ b/htsworkflow/frontend/samples/auth_backend.py @@ -3,6 +3,8 @@ from django.contrib.auth.backends import ModelBackend from django.core.exceptions import ImproperlyConfigured from django.db.models import get_model +import sys + class HTSUserModelBackend(ModelBackend): def authenticate(self, username=None, password=None): try: @@ -11,7 +13,7 @@ class HTSUserModelBackend(ModelBackend): return user #except self.user_class.DoesNotExist: except Exception, e: - print e + print >>sys.stderr, e return None def get_user(self, user_id): @@ -19,7 +21,7 @@ class HTSUserModelBackend(ModelBackend): return self.user_class.objects.get(pk=user_id) #except self.user_class.DoesNotExist: except Exception, e: - print e + print >>sys.stderr, e return None @property -- 2.30.2