def removethumbnail(userid, submitid): sub = Submission.query.get(submitid) thumbnail.clear_thumbnail(userid, submitid) # Thumbnails may be cached on the front page, so invalidate that cache. index.recent_submissions.invalidate() index.template_fields.invalidate(userid) otherid = sub.owner.userid title = sub.title note_about(userid, otherid, 'Thumbnail was removed for ' + text.markdown_link(title, '/submission/%s?anyway=true' % submitid))