Changeset 4771


Ignore:
Timestamp:
08/01/09 14:50:46 (11 years ago)
Author:
pjkersha
Message:

Use string.Template for username/password substitutions - enables $ style substitutions instead of % which conflict with ConfigFileParser? when included in a config file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg.security.server/ndg/security/server/authnservice/dbauthn.py

    r4770 r4771  
    2323    from md5 import md5 
    2424 
     25from string import Template 
    2526from sqlalchemy import create_engine 
    2627 
     
    6869         
    6970        try: 
    70             result = connection.execute(self.sqlQuery % dict(username=username, 
    71                                                              password=passwd)) 
     71            queryInputs = dict(username=username, password=passwd) 
     72            query = Template(self.sqlQuery).substitute(queryInputs) 
     73            result = connection.execute(query) 
    7274            if not result.rowcount: 
    7375                raise AuthNServiceInvalidCredentials() 
Note: See TracChangeset for help on using the changeset viewer.