Skip to content

Commit

Permalink
- Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed May 14, 2018
1 parent b0bb699 commit 959219b
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 42 deletions.
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ sudo: required

language: python

cache:
directories:
- $HOME/.cache/pip

before_cache:
- rm -f $HOME/.cache/pip/log/debug.log
# AF: seems like causing stall on Travis build
# cache:
# directories:
# - $HOME/.cache/pip
#
# before_cache:
# - rm -f $HOME/.cache/pip/log/debug.log

python:
- "2.7"
Expand Down
5 changes: 4 additions & 1 deletion geonode/api/resourcebase_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,10 @@ def format_objects(self, objects):
if hasattr(obj, 'storeType'):
formatted_obj['store_type'] = obj.storeType
if obj.storeType == 'remoteStore' and hasattr(obj, 'remote_service'):
formatted_obj['online'] = (obj.remote_service.probe == 200)
if obj.remote_service:
formatted_obj['online'] = (obj.remote_service.probe == 200)
else:
formatted_obj['online'] = False

formatted_obj['gtype'] = self.dehydrate_gtype(bundle)

Expand Down
4 changes: 2 additions & 2 deletions geonode/contrib/monitoring/models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#
#########################################################################
#
# Copyright (C) 2017 OSGeo
#
Expand All @@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
#########################################################################
from __future__ import print_function

import logging
Expand Down
4 changes: 2 additions & 2 deletions geonode/contrib/monitoring/tests.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
#
#########################################################################
#
# Copyright (C) 2017 OSGeo
#
Expand All @@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
#########################################################################

from __future__ import print_function

Expand Down
2 changes: 1 addition & 1 deletion geonode/maps/qgis_server_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def get_context_data(self, **kwargs):
visibility=True
)

if bbox is not None:
if bbox and len(bbox) >= 4:
minx, miny, maxx, maxy = [float(coord) for coord in bbox]
x = (minx + maxx) / 2
y = (miny + maxy) / 2
Expand Down
4 changes: 2 additions & 2 deletions geonode/maps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ def map_embed_widget(request, mapid,
else:
map_bbox = llbbox_to_mercator([float(coord) for coord in map_bbox])

if map_bbox is not None:
if map_bbox and len(map_bbox) >= 4:
minx, miny, maxx, maxy = [float(coord) for coord in map_bbox]
x = (minx + maxx) / 2
y = (miny + maxy) / 2
Expand Down Expand Up @@ -1022,7 +1022,7 @@ def sld_definition(style):

layers.append(maplayer)

if bbox is not None:
if bbox and len(bbox) >= 4:
minx, maxx, miny, maxy = [float(coord) for coord in bbox]
x = (minx + maxx) / 2
y = (miny + maxy) / 2
Expand Down
2 changes: 1 addition & 1 deletion geonode/proxy/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def proxy(request, url=None, response_callback=None,
conn = HTTPSConnection(url.hostname, url.port)
else:
conn = HTTPConnection(url.hostname, url.port)
conn.request(request.method, locator, request.body, headers)
conn.request(request.method, locator.encode('utf8'), request.body, headers)
response = conn.getresponse()
content = response.read()
status = response.status
Expand Down
25 changes: 0 additions & 25 deletions geonode/static/geonode/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -7900,29 +7900,4 @@ form-inline {
#missing-values {
color: #bd362f;
font-style: italic;
}g-values {
color: #bd362f;
font-style: italic;
}g-values {
color: #bd362f;
font-style: italic;
}g-values {
color: #bd362f;
font-style: italic;
}g-values {
color: #bd362f;
font-style: italic;
}g-values {
color: #bd362f;
font-style: italic;
}g-values {
color: #bd362f;
font-style: italic;
}g-values {
color: #bd362f;
font-style: italic;
}c;
}g-values {
color: #bd362f;
font-style: italic;
}
5 changes: 4 additions & 1 deletion geonode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,10 @@ def designals():

for signalname in signalnames:
if signalname in signals_store:
signaltype = getattr(models.signals, signalname)
try:
signaltype = getattr(models.signals, signalname)
except:
continue
logger.debug("RETRIEVE: %s: %d" %
(signalname, len(signaltype.receivers)))
signals_store[signalname] = []
Expand Down
3 changes: 2 additions & 1 deletion geonode/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def ajax_lookup(request):
keyword = request.POST['query']
users = get_user_model().objects.filter(Q(username__icontains=keyword)).exclude(Q(username='AnonymousUser') |
Q(is_active=False))
groups = GroupProfile.objects.filter(Q(title__icontains=keyword))
groups = GroupProfile.objects.filter(Q(title__icontains=keyword) |
Q(slug__icontains=keyword))
json_dict = {
'users': [({'username': u.username}) for u in users],
'count': users.count(),
Expand Down

0 comments on commit 959219b

Please sign in to comment.