This commit is contained in:
j 2021-11-15 11:36:03 +00:00
parent 65fc082b1b
commit 476fa9f0a3

View file

@ -59,11 +59,11 @@ def redirect_url(request, url):
if settings.CONFIG['site'].get('sendReferrer', False): if settings.CONFIG['site'].get('sendReferrer', False):
return redirect(url) return redirect(url)
else: else:
return HttpResponse('<script>document.location.href=%s;</script>'%json.dumps(url)) return HttpResponse('<script>document.location.href=%s;</script>' % json.dumps(url))
def opensearch_xml(request): def opensearch_xml(request):
osd = ET.Element('OpenSearchDescription') osd = ET.Element('OpenSearchDescription')
osd.attrib['xmlns']="http://a9.com/-/spec/opensearch/1.1/" osd.attrib['xmlns'] = "http://a9.com/-/spec/opensearch/1.1/"
e = ET.SubElement(osd, 'ShortName') e = ET.SubElement(osd, 'ShortName')
e.text = settings.SITENAME e.text = settings.SITENAME
e = ET.SubElement(osd, 'Description') e = ET.SubElement(osd, 'Description')