Commit 59504725 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

Drop compat for cubicweb < 3.21 in primary.rdf view

Related to #17133718.
parent ee776bbaca2f
......@@ -17,9 +17,6 @@
from io import BytesIO
from six import text_type
from cubicweb.__pkginfo__ import numversion
from cubicweb.predicates import adaptable
from cubicweb.view import EntityView
......@@ -35,7 +32,7 @@ class RDFPrimaryView(EntityView):
__select__ = EntityView.__select__ & adaptable(adapter)
templatable = False
content_type = 'application/rdf+xml'
binary = numversion >= (3, 21)
binary = True
def call(self):
graph = default_graph()
......@@ -52,19 +49,10 @@ class RDFPrimaryView(EntityView):
if dump:
self._dump(graph)
if binary:
def _dump(self, graph):
fobj = BytesIO()
graph.dump(fobj, rdf_format='xml')
self.w(fobj.getvalue())
else:
def _dump(self, graph):
fobj = BytesIO()
graph.dump(fobj, rdf_format='xml')
self.w(text_type(fobj.getvalue(), 'utf-8'))
def _dump(self, graph):
fobj = BytesIO()
graph.dump(fobj, rdf_format='xml')
self.w(fobj.getvalue())
class RDFListView(RDFPrimaryView):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment