syegulalp / mercury

Pure Python CMS and blogging solution using static HTML
http://mercury.genjipress.com
Other
18 stars 2 forks source link

'Save and publish' on include template type causes an error #85

Closed syegulalp closed 8 years ago

syegulalp commented 9 years ago
Error: TypeError
'NoneType' object is not iterable

(500, 'Internal Server Error', TypeError("'NoneType' object is not iterable",), 'Traceback (most recent call last):\n File "/home/genjipre/beta/cms/core/libs/bottle.py", line 863, in _handle\n return route.call(**args)\n File "/home/genjipre/beta/cms/core/libs/bottle.py", line 1733, in wrapper\n rv = callback(*a, **ka)\n File "/home/genjipre/beta/cms/core/routes.py", line 313, in template_edit_save\n return ui.template_edit_save(template_id)\n File "/home/genjipre/beta/cms/core/models/transaction.py", line 16, in wrapper\n fn = func(*a, **ka)\n File "/home/genjipre/beta/cms/core/ui/__init__.py", line 1442, in template_edit_save\n message = _template.save(request, user, template)\n File "/home/genjipre/beta/cms/core/template.py", line 76, in save\n for f in cms_template.fileinfos_published:\nTypeError: \'NoneType\' object is not iterable\n')

Traceback:

Traceback (most recent call last):
  File "/home/genjipre/beta/cms/core/libs/bottle.py", line 863, in _handle
    return route.call(**args)
  File "/home/genjipre/beta/cms/core/libs/bottle.py", line 1733, in wrapper
    rv = callback(*a, **ka)
  File "/home/genjipre/beta/cms/core/routes.py", line 313, in template_edit_save
    return ui.template_edit_save(template_id)
  File "/home/genjipre/beta/cms/core/models/transaction.py", line 16, in wrapper
    fn = func(*a, **ka)
  File "/home/genjipre/beta/cms/core/ui/__init__.py", line 1442, in template_edit_save
    message = _template.save(request, user, template)
  File "/home/genjipre/beta/cms/core/template.py", line 76, in save
    for f in cms_template.fileinfos_published:
TypeError: 'NoneType' object is not iterable
syegulalp commented 9 years ago

This is likely due to no fileinfo being generated for includes, so we need to skip that for those types of templates.

syegulalp commented 8 years ago

Fixed in daef65c4a8026bda0fa44e8429a3ab04ceb1b9cf