You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DataError: ERROR: value too long for type character(200) #80
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)
Activity
Bouke commentedon Feb 14, 2018
What database backend are you using?
habryk93 commentedon Jun 27, 2018
Postgres, but it is not problem with DB, you restrict your user_agent field to 200 symbols.
https://stackoverflow.com/questions/654921/how-big-can-a-user-agent-string-get