changeset 355:5bbcc0cac389

added session remove in forms, and added name and lastname to auth user
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 21 Jul 2010 22:57:36 +0200
parents 7a086a83f00b
children b0715a788432
files pylons_app/lib/auth.py pylons_app/model/forms.py
diffstat 2 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pylons_app/lib/auth.py	Wed Jul 21 22:55:47 2010 +0200
+++ b/pylons_app/lib/auth.py	Wed Jul 21 22:57:36 2010 +0200
@@ -77,6 +77,8 @@
     """
     def __init__(self):
         self.username = 'None'
+        self.name = ''
+        self.lastname = ''
         self.user_id = None
         self.is_authenticated = False
         self.is_admin = False
--- a/pylons_app/model/forms.py	Wed Jul 21 22:55:47 2010 +0200
+++ b/pylons_app/model/forms.py	Wed Jul 21 22:57:36 2010 +0200
@@ -97,6 +97,8 @@
                     auth_user.is_authenticated = True
                     auth_user.is_admin = user.admin
                     auth_user.user_id = user.user_id
+                    auth_user.name = user.name
+                    auth_user.lastname = user.lastname
                     session['hg_app_user'] = auth_user
                     session.save()
                     log.info('user %s is now authenticated', username)
@@ -122,7 +124,7 @@
                                          value, state,
                                          error_dict=self.e_dict_disable)
             
-            
+        meta.Session.remove()                
 class ValidRepoUser(formencode.validators.FancyValidator):
             
     def to_python(self, value, state):