jgorset/fandjango — Issue #43: oauth token longer than 255 characters
Author: bulkan
Created: 2011-12-05 01:16:13+00:00
State: open

Hi,

We have had a couple of cases were the OAuth token is longer than 255 characters and causes the following;

Traceback (most recent call last):
File "/home/www/mymoapp_env/lib/python2.6/site-packages/django/core/handlers/base.py", line 89, in get_response
response = middleware_method(request)
File "/home/www/mymoapp_env/lib/python2.6/site-packages/fandjango/middleware.py", line 113, in process_request
oauth_token = oauth_token
File "/home/www/mymoapp_env/lib/python2.6/site-packages/django/db/models/manager.py", line 138, in create
return self.get_query_set().create(**kwargs)
File "/home/www/mymoapp_env/lib/python2.6/site-packages/django/db/models/query.py", line 360, in create
obj.save(force_insert=True, using=self.db)
File "/home/www/mymoapp_env/lib/python2.6/site-packages/django/db/models/base.py", line 460, in save
self.save_base(using=using, force_insert=force_insert, force_update=force_update)
File "/home/www/mymoapp_env/lib/python2.6/site-packages/django/db/models/base.py", line 553, in save_base
result = manager._insert(values, return_id=update_pk, using=using)
File "/home/www/mymoapp_env/lib/python2.6/site-packages/django/db/models/manager.py", line 195, in _insert
return insert_query(self.model, values, **kwargs)
File "/home/www/mymoapp_env/lib/python2.6/site-packages/django/db/models/query.py", line 1436, in insert_query
return query.get_compiler(using=using).execute_sql(return_id)
File "/home/www/mymoapp_env/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 791, in execute_sql
cursor = super(SQLInsertCompiler, self).execute_sql(None)
File "/home/www/mymoapp_env/lib/python2.6/site-packages/django/db/models/sql/compiler.py", line 735, in execute_sql
cursor.execute(sql, params)
File "/home/www/mymoapp_env/lib/python2.6/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
return self.cursor.execute(query, args)
DatabaseError: value too long for type character varying(255)