Commits

Anonymous committed 7d49711

Fix backwards compatibility of main Mimeview API, which previously was getting passed a request object, not a context.

  • Participants
  • Parent commits cbae6fc
  • Branches trunk

Comments (0)

Files changed (1)

trac/mimeview/api.py

         """
         if not content:
             return ''
+        if not isinstance(context, Context):
+            # backwards compatibility: the first argument used to be the
+            # request prior to 0.11
+            context = Context.from_request(context)
 
         # Ensure we have a MIME type for this content
         full_mimetype = mimetype