File "/python2.7/site-packages/django/core/handlers/base.py", line 199, in get_response
response = middleware_method(request, response)
File "/python2.7/site-packages/user_sessions/middleware.py", line 46, in process_response
request.session.save()
File "/python2.7/site-packages/user_sessions/backends/db.py", line 78, in save
obj.save(force_insert=must_create, using=using)
DataError: ERROR: value too long for type character(200)
Possible Solution
Should change Session model field user_agent from CharField to TextField
user_agent = models.CharField(null=True, blank=True, max_length=200)
to
user_agent = models.TextField(null=True, blank=True)
or
cropp user_agent field before save to db(but it can delete necessary information)
or
add max_length for exaple with 500 to TextField, but its not limit field in DB, only in django
Steps to Reproduce (for bugs)
Add link to my page on facebook
Go to link
Facebook add some info to user_agent info
Page return 500 (DataError: ERROR: value too long for type character)
Error when send to long user-agent header
Expected Behavior
Status 200
Current Behavior
File "/python2.7/site-packages/django/core/handlers/base.py", line 199, in get_response response = middleware_method(request, response)
File "/python2.7/site-packages/user_sessions/middleware.py", line 46, in process_response request.session.save()
File "/python2.7/site-packages/user_sessions/backends/db.py", line 78, in save obj.save(force_insert=must_create, using=using)
DataError: ERROR: value too long for type character(200)
Possible Solution
Should change Session model field user_agent from CharField to TextField user_agent = models.CharField(null=True, blank=True, max_length=200) to user_agent = models.TextField(null=True, blank=True) or cropp user_agent field before save to db(but it can delete necessary information) or add max_length for exaple with 500 to TextField, but its not limit field in DB, only in django
Steps to Reproduce (for bugs)
Context
Your Environment