Postgres can't truncate the nickname if it's more than 30 characters

Bug #1092681 reported by Adnane Belmadiaf
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
django-openid-auth
New
Undecided
Unassigned

Bug Description

If someone with a nickname (>30) tries to connect Postgres will throw an error :

Traceback (most recent call last):

  File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py", line 92, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/usr/lib/pymodules/python2.6/django/contrib/csrf/middleware.py", line 135, in wrapped_view
    resp = view_func(*args, **kwargs)

  File "/usr/lib/pymodules/python2.6/django/contrib/csrf/middleware.py", line 148, in wrapped_view
    return view_func(*args, **kwargs)

  File "/usr/lib/python2.6/dist-packages/django_openid_auth/views.py", line 267, in login_complete
    user = authenticate(openid_response=openid_response)

  File "/usr/lib/pymodules/python2.6/django/contrib/auth/__init__.py", line 37, in authenticate
    user = backend.authenticate(**credentials)

  File "/usr/lib/python2.6/dist-packages/django_openid_auth/auth.py", line 77, in authenticate
    user = self.create_user_from_openid(openid_response)

  File "/usr/lib/python2.6/dist-packages/django_openid_auth/auth.py", line 233, in create_user_from_openid
    user = User.objects.create_user(username, email, password=None)

  File "/usr/lib/pymodules/python2.6/django/contrib/auth/models.py", line 105, in create_user
    user.save()

  File "/usr/lib/pymodules/python2.6/django/db/models/base.py", line 410, in save
    self.save_base(force_insert=force_insert, force_update=force_update)

  File "/usr/lib/pymodules/python2.6/django/db/models/base.py", line 495, in save_base
    result = manager._insert(values, return_id=update_pk)

  File "/usr/lib/pymodules/python2.6/django/db/models/manager.py", line 177, in _insert
    return insert_query(self.model, values, **kwargs)

  File "/usr/lib/pymodules/python2.6/django/db/models/query.py", line 1087, in insert_query
    return query.execute_sql(return_id)

  File "/usr/lib/pymodules/python2.6/django/db/models/sql/subqueries.py", line 320, in execute_sql
    cursor = super(InsertQuery, self).execute_sql(None)

  File "/usr/lib/pymodules/python2.6/django/db/models/sql/query.py", line 2369, in execute_sql
    cursor.execute(sql, params)

DataError: value too long for type character varying(30)

Adnane Belmadiaf (daker)
summary: - Postgres can't truncate the nickname if it's more than 30 caracters
+ Postgres can't truncate the nickname if it's more than 30 characters
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.