Chris Biersbach (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/6.1-opw-578969-cbi into 
lp:openobject-addons/6.1.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578969-cbi/+merge/127645

To reproduce this issue, try to send invitations via the module survey.

On non-english-locale systems, this will cause a Traceback with a 
UnicodeDecodeError.

The cause of this is the function string.letters, called when generating the 
password.
This return only a-z,A-Z in english locale but also special characters in other 
locale.
The solution was to replace it with a call to string.ascii_letters, which 
always return a-z,A-Z.

I also removed some unused code that has been there for a long time (2010) and 
was never used since, so it is not needed anymore. I figured that it was some 
old debugging code that was not removed.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/6.1-opw-578969-cbi/+merge/127645
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/6.1-opw-578969-cbi.
=== modified file 'survey/wizard/survey_send_invitation.py'
--- survey/wizard/survey_send_invitation.py	2011-10-20 12:37:42 +0000
+++ survey/wizard/survey_send_invitation.py	2012-10-03 06:35:26 +0000
@@ -56,7 +56,7 @@
     }
 
     def genpasswd(self):
-        chars = string.letters + string.digits
+        chars = string.ascii_letters + string.digits
         return ''.join([choice(chars) for i in range(6)])
 
     def default_get(self, cr, uid, fields_list, context=None):
@@ -111,7 +111,6 @@
         act_id = self.pool.get('ir.actions.act_window')
         act_id = act_id.search(cr, uid, [('res_model', '=' , 'survey.name.wiz'), \
                         ('view_type', '=', 'form')])
-        out = "login,password\n"
         skipped = 0
         existing = ""
         created = ""
@@ -158,7 +157,6 @@
                     continue
 
                 passwd= self.genpasswd()
-                out+= addr.email + ',' + passwd + '\n'
                 mail= record['mail'] % {'login' : addr.email, 'passwd' : passwd, 'name' : addr.name}
                 if record['send_mail']:
                     ans = mail_message.schedule_with_attach(cr, uid, record['mail_from'], [addr.email], \

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to