django-seo2 icon indicating copy to clipboard operation
django-seo2 copied to clipboard

coercing to Unicode: need string or buffer, ContentType found

Open li5tun opened this issue 9 years ago • 9 comments

Any idea about this?

ERROR:django.request:Internal Server Error: /admin/djangoseo/youlunmetadatamodel/add/ Traceback (most recent call last): File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response response = wrapped_callback(request, _callback_args, *_callback_kwargs) File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 583, in wrapper return self.admin_site.admin_view(view)(_args, *_kwargs) File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 105, in _wrapped_view response = view_func(request, _args, *_kwargs) File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func response = view_func(request, _args, *_kwargs) File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 206, in inner return view(request, _args, *_kwargs) File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1453, in add_view return self.changeform_view(request, None, form_url, extra_context) File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 29, in _wrapper return bound_func(_args, *_kwargs) File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 105, in _wrapped_view response = view_func(request, _args, *_kwargs) File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/utils/decorators.py", line 25, in bound_func return func.get(self, type(self))(_args2, *_kwargs2) File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/db/transaction.py", line 394, in inner return func(_args, *_kwargs) File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1407, in changeform_view self.log_addition(request, new_object) File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 776, in log_addition object_repr=force_text(object), File "/home/vagrant/virtualenv/local/lib/python2.7/site-packages/django/utils/encoding.py", line 85, in force_text s = six.text_type(s) TypeError: coercing to Unicode: need string or buffer, ContentType found

li5tun avatar Jan 22 '16 10:01 li5tun

https://github.com/romansalin/django-seo2/blob/952741849974415edc44bba0200d1c3b48c01fc2/djangoseo/backends.py#L451 I think this one should return a string, instead of content_type.

li5tun avatar Jan 23 '16 10:01 li5tun

We have hit this error too, the grappelli admin wont load because of it. It also stops you from printing it in the console.

In [10]: ObjectMetaDataModel.objects.all()
Out[10]: ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
... snip ...
TypeError: coercing to Unicode: need string or buffer, ContentType found

In [11]: 

mic159 avatar Feb 10 '16 01:02 mic159

Same problem, is anybody knows how to fix if ?

fzdmd avatar Feb 17 '16 10:02 fzdmd

fixed in: https://github.com/romansalin/django-seo2/commit/68d1184064fa3b94dafce93610191cc7fa5a5a04

fragmuffin avatar Aug 09 '16 04:08 fragmuffin

Yeah, looks like this was in PR #13. @romansalin any chance on getting a release uploaded to pypi? Its been more than 24 hours :cry:

mic159 avatar Aug 10 '16 00:08 mic159

Hey @romansalin , Can you please release the new updated patch to pypi as the version downloaded via pip still throws this error.

Shivam1904 avatar Aug 25 '16 12:08 Shivam1904

@romansalin please release to pypi!

mic159 avatar Nov 25 '16 03:11 mic159

@romansalin bump!

mic159 avatar Feb 08 '17 05:02 mic159

@romansalin, please release the fix...

fannyhub avatar Jul 26 '17 18:07 fannyhub