From 6a861eb17da16c9bd1e9294864a58352ff405889 Mon Sep 17 00:00:00 2001 From: Max Goodman Date: Wed, 6 Jun 2012 17:00:04 -0700 Subject: [PATCH] Add def catch-all to NullJsonTemplate. This fixes AttributeErrors when trying to render about pages as .json. --- r2/r2/lib/jsontemplates.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/r2/r2/lib/jsontemplates.py b/r2/r2/lib/jsontemplates.py index 9f0fc15f9..9ef3722ce 100755 --- a/r2/r2/lib/jsontemplates.py +++ b/r2/r2/lib/jsontemplates.py @@ -484,6 +484,9 @@ class NullJsonTemplate(JsonTemplate): def render(self, thing = None, *a, **kw): return "" + def get_def(self, name): + return self + class ListingJsonTemplate(ThingJsonTemplate): _data_attrs_ = dict(children = "things", after = "after",