Commits

Simone Marzola committed 27d6b2f

better @expose('json') decorator

  • Participants
  • Parent commits d03648e
  • Branches artichoke

Comments (0)

Files changed (1)

artichoke/controller.py

 
     if template == 'json':
         content_type = 'application/json'
+        template = None
 
     def decorate(f):
         f.exposed = True
         if not hasattr(f, 'artichoke'):
             f.artichoke = {}
 
-        f.artichoke['template'] = template if content_type == 'text/html' else None
+        f.artichoke['template'] = template
         f.artichoke['content-type'] = content_type
         return f
     return decorate