Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coercing to Unicode: need string or buffer, ContentType found #8

Open
li5tun opened this issue Jan 22, 2016 · 9 comments
Open

coercing to Unicode: need string or buffer, ContentType found #8

li5tun opened this issue Jan 22, 2016 · 9 comments

Comments

@li5tun
Copy link

li5tun commented Jan 22, 2016

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
Copy link
Author

li5tun commented Jan 23, 2016

return self._content_type

I think this one should return a string, instead of content_type.

@mic159
Copy link

mic159 commented Feb 10, 2016

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]: 

@fzdmd
Copy link

fzdmd commented Feb 17, 2016

Same problem, is anybody knows how to fix if ?

@fragmuffin
Copy link

fixed in: 68d1184

@mic159
Copy link

mic159 commented Aug 10, 2016

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

@Shivam1904
Copy link

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

@mic159
Copy link

mic159 commented Nov 25, 2016

@romansalin please release to pypi!

@mic159
Copy link

mic159 commented Feb 8, 2017

@romansalin bump!

@fannyhub
Copy link

@romansalin, please release the fix...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants