django-blog-zinnia / cmsplugin-zinnia

Bridge between django-blog-zinnia and django-cms
BSD 3-Clause "New" or "Revised" License
53 stars 46 forks source link

AttributeError on rendering RSS or when trying to "ping" after posting a comment #15

Closed romlok closed 10 years ago

romlok commented 11 years ago

I've just upgraded to the latest Zinnia. I've updated all the things I can find which need updating, and it appears to work perfectly to the user. Watching the dev server output, however, shows this traceback every time a comment is posted (successfully, I might add):

Exception in thread Thread-39:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/home/mel/.virtualenvs/easym-django/local/lib/python2.7/site-packages/zinnia/ping.py", line 99, in run
    external_urls = self.find_external_urls(self.entry)
  File "/home/mel/.virtualenvs/easym-django/local/lib/python2.7/site-packages/zinnia/ping.py", line 118, in find_external_urls
    soup = BeautifulSoup(entry.html_content)
  File "/home/mel/.virtualenvs/easym-django/local/lib/python2.7/site-packages/cmsplugin_zinnia/placeholder.py", line 39, in html_content
    return render_placeholder(self.content_placeholder, context)
  File "/home/mel/.virtualenvs/easym-django/local/lib/python2.7/site-packages/cms/plugin_rendering.py", line 92, in render_placeholder
    context.push()
AttributeError: 'NoneType' object has no attribute 'push'

It appears to be that EntryPlaceholder.acquire_context isn't finding any context argument in the stack. Indeed, it seems the only args which show up in the inspect.stack() are five selfs, with one of them accompanied by an entry.

Versions: Django==1.5.1 cmsplugin-zinnia==0.4 django-blog-zinnia==0.12.3 (upgraded from 0.11.2) django-cms==2.4.2 (and loads more stuff, if you need versions of the deps, etc.)

romlok commented 11 years ago

Looks like this also affects, and so totally breaks, my RSS feed!

romlok commented 11 years ago

I've hacked in a fix, such that the acquire_context hack will always return a Context instance. It currently resides in my own fork: https://github.com/Raumkraut/cmsplugin-zinnia/commit/53d25950eb1ff21bb4488b60e802cb243735681f Should I initiate a pull request for this?

tightflks commented 10 years ago

YOU GUYS ARE AWESOME!

tightflks commented 10 years ago

also just want to mention this is a great product and keep up the great work!

Fantomas42 commented 10 years ago

@Raumkraut thanks for your fix.

Regards