jazzband / django-embed-video

Django app for easy embedding YouTube and Vimeo videos and music from SoundCloud.
http://django-embed-video.rtfd.org
MIT License
382 stars 135 forks source link

'NoneType' object has no attribute 'strip' #50

Closed sunjoomoon closed 8 years ago

sunjoomoon commented 9 years ago

django 1.6.10, embed_video, VERSION = (0, 10, 'stable')

models.py

video = EmbedVideoField(_('video url'), blank=True,null=True)

When I save the page empty field from admin, below is returned, what could cause this? But if I put youtube url, then it is saved okay and all in good shape.

'NoneType' object has no attribute 'strip'
bee-keeper commented 8 years ago

@sunjoomoon are you using any 3rd party apps? I'm also getting this error but with Django 1.8 and model translation.

yetty commented 8 years ago

@sunjoomoon please copy and paste full error stacktrace.

bee-keeper commented 8 years ago

I think the issue here is to with initialising with null=True, I presume Django does a strip() and this is what causes the error.

As per the thread here remove null=True and that fixes the problem.

sunjoomoon commented 8 years ago

Long time, yes indeed. somehow at the database level that is not quite happy with null value. As you said removing null=True did the job.