Bug #943

snf-admin user invite is not non-ascii friendly

Added by Alexandros Kosiaris almost 11 years ago. Updated almost 11 years ago.

Status:Closed Start date:07/26/2011
Priority:Medium Due date:
Assignee:Giorgos Verigakis % Done:

100%

Category:Admin Spent time: -
Target version:v0.5.4

Description

Unaware whether this bites other invocations of snf-admin, but trying to invite a user using non-ascii character set for his name produces the following

$ snf-admin user invite 1 'Ανύπαρκτος Χρήστης'

/usr/lib/pymodules/python2.6/django/db/backends/mysql/base.py:86: Warning: Incorrect string value: '\xCF\xCE' for column 'name' at row 1
return self.cursor.execute(query, args)
Traceback (most recent call last):
File "/srv/okeanos/synnefo/tools/snf-admin", line 549, in <module>
main()
File "/srv/okeanos/synnefo/tools/snf-admin", line 545, in main
cmd.execute()
File "/srv/okeanos/synnefo/tools/snf-admin", line 125, in execute
self.main(*self.args)
File "/srv/okeanos/synnefo/tools/snf-admin", line 219, in main
inv = add_invitation(inviter, name, email)
File "/usr/lib/pymodules/python2.6/django/db/transaction.py", line 299, in _commit_on_success
res = func(*args, **kw)
File "/srv/okeanos/synnefo/invitations/invitations.py", line 284, in add_invitation
users.register_user(name, email)
File "/srv/okeanos/synnefo/logic/users.py", line 80, in register_user
_register_user(fullname, uname, email, 'USER')
File "/usr/lib/pymodules/python2.6/django/db/transaction.py", line 299, in _commit_on_success
res = func(*args, **kw)
File "/srv/okeanos/synnefo/logic/users.py", line 51, in _register_user
create_auth_token(user)
File "/usr/lib/pymodules/python2.6/django/db/transaction.py", line 299, in _commit_on_success
res = func(*args, **kw)
File "/srv/okeanos/synnefo/logic/users.py", line 86, in create_auth_token
md5.update(user.name.encode('ascii', 'ignore'))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 0: ordinal not in range(128)

Associated revisions

Revision 38f59f88
Added by Giorgos Verigakis almost 11 years ago

Make invitations.txt UTF-8

Refs #943

Revision 22f79931
Added by Giorgos Verigakis almost 11 years ago

Treat user input as utf-8

_register_user and add_invitation require unicode strings.

Fixes #943

History

#1 Updated by Vangelis Koukis almost 11 years ago

  • Category changed from logic to Admin
  • Status changed from New to Assigned
  • Assignee set to Giorgos Verigakis
  • Priority changed from Low to Medium
  • Target version set to v0.5.4

#2 Updated by Giorgos Verigakis almost 11 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF