Ticket #1930: tg-trunk.patch

File tg-trunk.patch, 1.9 kB (added by Gustavo, 2 years ago)

The updated patch for tg.config

  • tg/config.py

    old new  
    9196        config['pylons.h'] = self.package.lib.helpers 
    9297     
    9398    def setup_sa_auth_backend(self): 
    94         defaults = {'user_class':self.model.User,  
    95                               'group_class':self.model.Group,  
    96                               'permission_class':self.model.Permission, 
    97                               'users_table':'tg_user', 
    98                               'groups_table':'tg_group', 
    99                               'permissions_table':'tg_permission', 
    100                               'password_encryption_method':'sha1', 
    101                               'form_plugin': None 
    102                       } 
    103         if config.get('sa_auth'): 
    104             config['sa_auth'] = defaults.update(config['sa_auth']) 
    105         if not config['sa_auth']: 
    106             config['sa_auth'] = defaults 
     99        defaults = {'users_table':'tg_user', 
     100                    'groups_table':'tg_group', 
     101                    'permissions_table':'tg_permission', 
     102                    'password_encryption_method':'sha1', 
     103                    'form_plugin': None 
     104                   } 
     105        # The developer must have defined a 'sa_auth' section, because 
     106        # values such as the User, Group or Permission classes must be 
     107        # explicitly defined. 
     108        config['sa_auth'] = defaults.update(config['sa_auth']) 
    107109     
    108110    def setup_mako_renderer(self): 
    109111        # Create the Mako TemplateLookup, with the default auto-escaping 
     
    214216 
    215217        auth = self.sa_auth 
    216218 
    217         app = make_who_middleware(app, config, auth.user,  
     219        app = make_who_middleware(app, config, auth.user_class,  
    218220                                  auth.user_criterion,  
    219221                                  auth.user_id_column,  
    220222                                  auth.dbsession,