Skip to content

Commit c52aba0

Browse files
committed
Removed dependency on Django's Site model (for Wagtail compatibility)
1 parent f4f673c commit c52aba0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

gsa/__init__.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
Peter Cicman, Divio 2009
44
Stefan Foulis, Divio 2010
5+
David Wasylciw, 2016
56
67
More docs here:
78
http://code.google.com/apis/searchappliance/documentation/52/index.html
@@ -11,7 +12,6 @@
1112
import urllib2
1213
import itertools
1314
from xml.etree import ElementTree
14-
from django.contrib.sites.models import Site
1515
from gsa.queryset import FakeQuerySet
1616
from logging import getLogger
1717
logger = getLogger('gsa')
@@ -71,7 +71,6 @@ def query(self, q, site=None, lr=None, num=10, output="xml", client="default_fro
7171
self.data.update(kwargs)
7272

7373
_data = ["%s=%s" % (key, urllib2.quote(unicode(value).encode('utf8'))) for key, value in self.data.items()]
74-
#_data = ["%s=%s" % (key, urllib2.quote(value)) for key, value in self.data.items()]
7574

7675
url = "http://%(host)s/search?%(data)s" %{
7776
'host': self.host,
@@ -85,8 +84,7 @@ def query(self, q, site=None, lr=None, num=10, output="xml", client="default_fro
8584
#from traceback import format_exception
8685
#trace_exc = '\n'.join(format_exception(*sys.exc_info()))
8786

88-
current_site = Site.objects.get_current()
89-
subject = "GSA %s failed. (query: %s site: %s)" % (self.host, url, current_site)
87+
subject = "GSA %s failed. (query: %s)" % (self.host, url)
9088
logger.error(subject, exc_info=sys.exc_info())
9189
return GSAEmptyResult()
9290

0 commit comments

Comments
 (0)