SQL Server port: convert Password to Binary stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Tue, 22 Dec 2009 09:33:08 +0100
branchstable
changeset 4176 42247d70105b
parent 4148 748454627176
child 4177 f0ab2b6d3553
SQL Server port: convert Password to Binary This conversion is required because pyodbc uses buffers for Binary fields and won't be able to cast a string/unicode value to the db VARBINARY column type otherwise.
server/sqlutils.py
--- a/server/sqlutils.py	Fri Dec 18 15:59:19 2009 +0100
+++ b/server/sqlutils.py	Tue Dec 22 09:33:08 2009 +0100
@@ -241,6 +241,7 @@
                         value = value.getvalue()
                     else:
                         value = crypt_password(value)
+                    value = self.binary(value)
                 # XXX needed for sqlite but I don't think it is for other backends
                 elif atype == 'Datetime' and isinstance(value, date):
                     value = todatetime(value)