Skip to content

Commit

Permalink
fix the flow in maps/views.py
Browse files Browse the repository at this point in the history
  • Loading branch information
boney-bun committed Sep 19, 2017
1 parent 79cf26a commit e33f21d
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions geonode/maps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,14 @@ def perm_filter(layer):

# we need to remove duplicate layers
j_map = json.loads(mapJson)
json_layers = ""

for element in j_map["layers"]:
json_layers += element["name"]
j_layers = j_map["layers"]
for j_layer in j_layers:
if j_layer["service"] is None:
j_layers.remove(j_layer)
continue
if (len([l for l in j_layers if l == j_layer])) > 1:
j_layers.remove(j_layer)
mapJson = json.dumps(j_map)

if 'geonode.geoserver' in settings.INSTALLED_APPS:
# TODO the url needs to be verified on geoserver
Expand All @@ -749,11 +753,10 @@ def perm_filter(layer):
# qgis-server backend stop here, continue on qgis_server/views.py
return redirect(url)

# the path to geoserver
resp, content = http_client.request(url, 'POST', layers=layers)
# resp = requests.get(url)
# the path to geoserver backend continue here
resp, content = http_client.request(url, 'POST', layers=mapJson)

status = int(resp.status_code)
status = int(resp.status)

if status == 200:
map_status = json.loads(content)
Expand Down

0 comments on commit e33f21d

Please sign in to comment.