Skip to content

Commit

Permalink
Removed dependency on Django's Site model (for Wagtail compatibility)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwasyl committed Mar 26, 2018
1 parent f4f673c commit c52aba0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions gsa/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Peter Cicman, Divio 2009
Stefan Foulis, Divio 2010
David Wasylciw, 2016
More docs here:
http://code.google.com/apis/searchappliance/documentation/52/index.html
Expand All @@ -11,7 +12,6 @@
import urllib2
import itertools
from xml.etree import ElementTree
from django.contrib.sites.models import Site
from gsa.queryset import FakeQuerySet
from logging import getLogger
logger = getLogger('gsa')
Expand Down Expand Up @@ -71,7 +71,6 @@ def query(self, q, site=None, lr=None, num=10, output="xml", client="default_fro
self.data.update(kwargs)

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

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

current_site = Site.objects.get_current()
subject = "GSA %s failed. (query: %s site: %s)" % (self.host, url, current_site)
subject = "GSA %s failed. (query: %s)" % (self.host, url)
logger.error(subject, exc_info=sys.exc_info())
return GSAEmptyResult()

Expand Down

0 comments on commit c52aba0

Please sign in to comment.