webpy-bootstrap-blog icon indicating copy to clipboard operation
webpy-bootstrap-blog copied to clipboard

Internal server error when blog post with no images

Open mox1 opened this issue 10 years ago • 0 comments

2014-03-14 10:20:40,832 - blogstrap - ERROR - Internal error: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 239, in process return self.handle() File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 230, in handle return self._delegate(fn, self.fvars, args) File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 420, in _delegate return handle_class(cls) File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 396, in handle_class return tocall(*args) File "/var/www/blogstrappy/app.py", line 375, in GET content = render.blog_teasers(posts,"?n=%s" % (prev-1),"?n=%s" % (next+1)) File "/usr/local/lib/python2.7/dist-packages/web/template.py", line 881, in call return BaseTemplate.call(self, _a, *_kw) File "/usr/local/lib/python2.7/dist-packages/web/template.py", line 808, in call return self.t(_a, *_kw) File "/var/www/blogstrappy/templates/blog_teasers.html", line 12, in template $# If this is true, no results File "/var/www/blogstrappy/app.py", line 148, in t_globals["render"] = lambda t, _args: render._template(t)(_args) File "/usr/local/lib/python2.7/dist-packages/web/template.py", line 881, in call return BaseTemplate.call(self, _a, *_kw) File "/usr/local/lib/python2.7/dist-packages/web/template.py", line 808, in call return self.t(_a, *_kw) File "/var/www/blogstrappy/templates/singleteaser.html", line 10, in template $#$(blogpost.author) File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 614, in get return self.get_object_or_id(instance) File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 605, in get_object_or_id self.rel_model._meta.primary_key == rel_id) File "/usr/local/lib/python2.7/dist-packages/peewee.py", line 2325, in get return sq.get() File "/var/www/blogstrappy/model.py", line 36, in better_get self.sql())) ImageDoesNotExist: instance matching query does not exist: SQL: SELECT t1."id", t1."created_at", t1."url", t1."alt", t1."title", t1."author", t1."link", t1."license", t1."show" FROM "image" AS t1 WHERE (t1."id" = ?) PARAMS: [-1]

mox1 avatar Mar 14 '14 14:03 mox1