Show More
@@ -12,7 +12,8 b' log = logging.getLogger(__name__)' | |||||
12 | class LoginController(BaseController): |
|
12 | class LoginController(BaseController): | |
13 |
|
13 | |||
14 | def index(self): |
|
14 | def index(self): | |
15 | if session.get('hg_app_user', AuthUser()).is_authenticated: |
|
15 | #redirect if already logged in | |
|
16 | if c.hg_app_user.is_authenticated: | |||
16 | return redirect(url('hg_home')) |
|
17 | return redirect(url('hg_home')) | |
17 |
|
18 | |||
18 | if request.POST: |
|
19 | if request.POST: |
@@ -69,7 +69,6 b' class ValidAuth(formencode.validators.Fa' | |||||
69 | except (NoResultFound, MultipleResultsFound, OperationalError) as e: |
|
69 | except (NoResultFound, MultipleResultsFound, OperationalError) as e: | |
70 | log.error(e) |
|
70 | log.error(e) | |
71 | user = None |
|
71 | user = None | |
72 | print value |
|
|||
73 | if user: |
|
72 | if user: | |
74 | if user.active: |
|
73 | if user.active: | |
75 | if user.username == username and user.password == crypted_passwd: |
|
74 | if user.username == username and user.password == crypted_passwd: |
@@ -12,10 +12,11 b' Created on Apr 9, 2010' | |||||
12 | import os |
|
12 | import os | |
13 | from pylons import tmpl_context as c, app_globals as g, session, request, config |
|
13 | from pylons import tmpl_context as c, app_globals as g, session, request, config | |
14 | from pylons.controllers.util import abort |
|
14 | from pylons.controllers.util import abort | |
|
15 | import sys | |||
15 | try: |
|
16 | try: | |
16 | from vcs.backends.hg import get_repositories, MercurialRepository |
|
17 | from vcs.backends.hg import get_repositories, MercurialRepository | |
17 | except ImportError: |
|
18 | except ImportError: | |
18 |
|
|
19 | sys.stderr.write('You have to import vcs module') | |
19 | raise Exception('Unable to import vcs') |
|
20 | raise Exception('Unable to import vcs') | |
20 |
|
21 | |||
21 | class HgModel(object): |
|
22 | class HgModel(object): |
General Comments 0
You need to be logged in to leave comments.
Login now