##// END OF EJS Templates
Show only XML in raw post preview, browsers let user navigate it better
neko259 -
r1574:cc931fea default
parent child Browse files
Show More
@@ -1,5 +1,4 b''
1 import xml.etree.ElementTree as et
1 import xml.etree.ElementTree as et
2 import xml.dom.minidom
3
2
4 from django.http import HttpResponse, Http404
3 from django.http import HttpResponse, Http404
5 from boards.models import GlobalId, Post
4 from boards.models import GlobalId, Post
@@ -50,13 +49,7 b' def get_post_sync_data(request, post_id)'
50
49
51 xml_str = SyncManager.generate_response_get([post])
50 xml_str = SyncManager.generate_response_get([post])
52
51
53 xml_repr = xml.dom.minidom.parseString(xml_str)
54 xml_repr = xml_repr.toprettyxml()
55
56 content = '=Global ID=\n%s\n\n=XML=\n%s' \
57 % (post.global_id, xml_repr)
58
59 return HttpResponse(
52 return HttpResponse(
60 content_type='text/plain; charset=utf-8',
53 content_type='text/xml; charset=utf-8',
61 content=content,
54 content=xml_str,
62 ) No newline at end of file
55 )
General Comments 0
You need to be logged in to leave comments. Login now