Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

handle mysql statements

  • Loading branch information...
commit cffe7a191b22173a404e662b1f566be0dbaa977c 1 parent 9e47443
@vangheem vangheem authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 factored/finders.py
View
9 factored/finders.py
@@ -34,9 +34,12 @@ def engine(self):
return create_engine(self.connection_string)
def __call__(self, username):
- res = self.engine.execute('select %s from %s where %s=?' % (
- self.email_field, self.table_name, self.email_field),
- username)
+ select = 'select %s from %s where %s=?' % (self.email_field,
+ self.table_name, self.email_field)
+ engine = self.egine
+ if engine.driver == 'mysqldb':
+ select = select.replace('?', '%s')
+ res = self.engine.execute(select, username)
return len(res.fetchall()) > 0
addUserFinderPlugin(SQLUserFinder)
Please sign in to comment.
Something went wrong with that request. Please try again.