# HG changeset patch # User Marcin Kuzminski # Date 2010-05-22 14:07:28 # Node ID 7109d15c6813387100e5098d1e124f70de954fc1 # Parent 3d1dd13887f9da2e20379308b5fb47fe41d5a55e cleared prints leftoovers, and changed current user fetching in login controller diff --git a/pylons_app/controllers/login.py b/pylons_app/controllers/login.py --- a/pylons_app/controllers/login.py +++ b/pylons_app/controllers/login.py @@ -12,7 +12,8 @@ log = logging.getLogger(__name__) class LoginController(BaseController): def index(self): - if session.get('hg_app_user', AuthUser()).is_authenticated: + #redirect if already logged in + if c.hg_app_user.is_authenticated: return redirect(url('hg_home')) if request.POST: diff --git a/pylons_app/model/forms.py b/pylons_app/model/forms.py --- a/pylons_app/model/forms.py +++ b/pylons_app/model/forms.py @@ -69,7 +69,6 @@ class ValidAuth(formencode.validators.Fa except (NoResultFound, MultipleResultsFound, OperationalError) as e: log.error(e) user = None - print value if user: if user.active: if user.username == username and user.password == crypted_passwd: diff --git a/pylons_app/model/hg_model.py b/pylons_app/model/hg_model.py --- a/pylons_app/model/hg_model.py +++ b/pylons_app/model/hg_model.py @@ -12,10 +12,11 @@ Created on Apr 9, 2010 import os from pylons import tmpl_context as c, app_globals as g, session, request, config from pylons.controllers.util import abort +import sys try: from vcs.backends.hg import get_repositories, MercurialRepository except ImportError: - print 'You have to import vcs module' + sys.stderr.write('You have to import vcs module') raise Exception('Unable to import vcs') class HgModel(object):