mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Don't treat strings in ObjectTemplates as StringTemplates
This was leading to strange behaviour like `<$>timesince</$>` in a random string field rending as `just now`. It might have been necessary when we were caching `JsonTemplate`s, but we don't anymore.
This commit is contained in:
@@ -52,7 +52,7 @@ class ObjectTemplate(StringTemplate):
|
||||
def update(self, kw):
|
||||
def _update(obj):
|
||||
if isinstance(obj, (str, unicode)):
|
||||
return StringTemplate(obj).finalize(kw)
|
||||
return _force_unicode(obj)
|
||||
elif isinstance(obj, dict):
|
||||
return dict((k, _update(v)) for k, v in obj.iteritems())
|
||||
elif isinstance(obj, (list, tuple)):
|
||||
|
||||
Reference in New Issue
Block a user