Skip to content

Commit

Permalink
Merge pull request #2 from GeoNode/master
Browse files Browse the repository at this point in the history
merge from geonode
  • Loading branch information
kikislater authored Jul 11, 2019
2 parents 47ff46a + 19a2e80 commit f41c355
Show file tree
Hide file tree
Showing 27 changed files with 191 additions and 154 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM geonode/geonode:latest
FROM geonode/geonode:2.10
MAINTAINER GeoNode development team

COPY requirements.txt /usr/src/app/
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ http://master.demo.geonode.org. After your registration you will be able
to test all basic functionalities like uploading layers, creation of
maps, editing metadata, styles and much more. To get an overview what
GeoNode can do we recommend to have a look at the [Users
Workshop](http://docs.geonode.org/en/master/tutorials/users/index.html).
Workshop](http://docs.geonode.org/en/2.10.x/usage/index.html).

Install
-------
Expand All @@ -54,17 +54,17 @@ GeoNode can be setup in different ways, flavors and plattforms. If
you´re planning to do development or install for production please visit
the offical GeoNode installation documentation:

- [Docker](http://docs.geonode.org/en/master/install/core/index.html#docker)
- [Ubuntu 18.04](http://docs.geonode.org/en/master/install/core/index.html#ubuntu-18-04)
- [Docker](http://docs.geonode.org/en/2.10.x/install/core/index.html#docker)
- [Ubuntu 18.04](http://docs.geonode.org/en/2.10.x/install/core/index.html#ubuntu-18-04)

Learn GeoNode
-------------

After you´ve finished the setup process make yourself familiar with the
general usage and settings of your GeoNodes instance. - the [User
Training](http://docs.geonode.org/en/master/tutorials/users/index.html)
Training](http://docs.geonode.org/en/2.10.x/usage/index.html)
is going in depth into what we can do. - the [Administrators
Workshop](http://docs.geonode.org/en/master/tutorials/admin/index.html)
Workshop](http://docs.geonode.org/en/2.10.x/admin/index.html)
will guide you to the most important parts regarding management commands
and configuration settings.

Expand All @@ -83,7 +83,7 @@ lightweight components to speed up things.
To get you started have a look at the [Install
instructions](#install) which cover all what is needed to run GeoNode
for development. Further visit the the [Developer
workshop](http://docs.geonode.org/en/master/tutorials/devel/index.html)
workshop](http://docs.geonode.org/en/2.10.x/devel/index.html)
for a basic overview.

If you're planning of customizing your GeoNode instance, or to extend
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.async.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ services:

celery:
restart: unless-stopped
image: geonode/geonode:latest
image: geonode/geonode:2.10
container_name: celery4${COMPOSE_PROJECT_NAME}
stdin_open: true
# tty: true
Expand Down Expand Up @@ -79,7 +79,7 @@ services:

django:
restart: unless-stopped
image: geonode/geonode:latest
image: geonode/geonode:2.10
container_name: django4${COMPOSE_PROJECT_NAME}
stdin_open: true
# tty: true
Expand All @@ -100,7 +100,7 @@ services:
- ./scripts/docker/env/${SET_DOCKER_ENV}/django.env

geonode:
image: geonode/nginx:geoserver
image: geonode/nginx:${SET_DOCKER_ENV}
restart: unless-stopped
container_name: nginx4${COMPOSE_PROJECT_NAME}
stdin_open: true
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:

django:
restart: unless-stopped
image: geonode/geonode:latest
image: geonode/geonode:2.10
container_name: django4${COMPOSE_PROJECT_NAME}
stdin_open: true
# tty: true
Expand All @@ -54,7 +54,7 @@ services:
- ./scripts/docker/env/${SET_DOCKER_ENV}/django.env

geonode:
image: geonode/nginx:geoserver
image: geonode/nginx:${SET_DOCKER_ENV}
restart: unless-stopped
container_name: nginx4${COMPOSE_PROJECT_NAME}
stdin_open: true
Expand Down
2 changes: 1 addition & 1 deletion docs/basic/theme/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ You can see on `line 189 of the GeoNode base.html template <https://github.com/G
{% if not custom_theme.jumbotron_cta_hide %}
<p>
<a class="btn btn-default btn-lg" target="_blank" role="button"
href="{{custom_theme.jumbotron_cta_link|default:_('http://docs.geonode.org/en/master/usage/')}}">
href="{{custom_theme.jumbotron_cta_link|default:_('http://docs.geonode.org/en/2.10.x/usage/')}}">
{{custom_theme.jumbotron_cta_text|default:_("Get Started &raquo;")}}
</a>
</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/install/core/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ It is possible to let docker show which containers are currently running (add ``
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
3b232931f820 geonode/nginx:geoserver "nginx -g 'daemon of…" 26 minutes ago Up 26 minutes 0.0.0.0:80->80/tcp nginx4geonode
3b232931f820 geonode/nginx:production "nginx -g 'daemon of…" 26 minutes ago Up 26 minutes 0.0.0.0:80->80/tcp nginx4geonode
ff7002ae6e91 geonode/geonode:latest "/usr/src/app/entryp…" 26 minutes ago Up 26 minutes 8000/tcp django4geonode
2f155e5043be geonode/geoserver:2.14.3 "/usr/local/tomcat/t…" 26 minutes ago Up 26 minutes 8080/tcp geoserver4geonode
97f1668a01b1 geonode_celery "/usr/src/app/entryp…" 26 minutes ago Up 26 minutes 8000/tcp geonode_celery_1
Expand Down
2 changes: 1 addition & 1 deletion geonode/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import os

__version__ = (2, 10, 0, 'rc', 5)
__version__ = (2, 10, 0, 'final', 0)


default_app_config = "geonode.apps.AppConfig"
Expand Down
9 changes: 9 additions & 0 deletions geonode/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,15 @@ def resourcebase_post_save(instance, *args, **kwargs):
if tb:
logger.debug(tb)

try:
# refresh catalogue metadata records
from geonode.catalogue.models import catalogue_post_save
catalogue_post_save(instance=instance, sender=instance.__class__)
except BaseException:
tb = traceback.format_exc()
if tb:
logger.debug(tb)


def rating_post_save(instance, *args, **kwargs):
"""
Expand Down
20 changes: 9 additions & 11 deletions geonode/documents/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,21 +420,19 @@ def document_metadata(
if author_form.has_changed and author_form.is_valid():
new_author = author_form.save()

the_document = document_form.instance
document = document_form.instance
if new_poc is not None and new_author is not None:
the_document.poc = new_poc
the_document.metadata_author = new_author
document.poc = new_poc
document.metadata_author = new_author
if new_keywords:
the_document.keywords.clear()
the_document.keywords.add(*new_keywords)
document.keywords.clear()
document.keywords.add(*new_keywords)
if new_regions:
the_document.regions.clear()
the_document.regions.add(*new_regions)
the_document.save()
document.regions.clear()
document.regions.add(*new_regions)
document.category = new_category
document.save()
document_form.save_many2many()
Document.objects.filter(
id=the_document.id).update(
category=new_category)

if not ajax:
return HttpResponseRedirect(
Expand Down
15 changes: 9 additions & 6 deletions geonode/geoserver/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
from threading import local
import time
import uuid

import base64
import urllib
from urlparse import urlsplit, urlparse, urljoin
from urlparse import urlsplit, urljoin

from agon_ratings.models import OverallRating
from bs4 import BeautifulSoup
Expand Down Expand Up @@ -73,7 +73,7 @@
msg = (
'Please configure OGC_SERVER when enabling geonode.geoserver.'
' More info can be found at '
'http://docs.geonode.org/en/master/basic/settings/index.html#ogc-server')
'http://docs.geonode.org/en/2.10.x/basic/settings/index.html#ogc-server')
raise ImproperlyConfigured(msg)


Expand Down Expand Up @@ -1881,8 +1881,10 @@ def get_time_info(layer):
def _render_thumbnail(req_body, width=240, height=180):
spec = _fixup_ows_url(req_body)
url = "%srest/printng/render.png" % ogc_server_settings.LOCATION
hostname = urlparse(settings.SITEURL).hostname
params = dict(width=width, height=height, auth="%s,%s,%s" % (hostname, _user, _password))
headers = {'Content-type': 'text/html'}
valid_uname_pw = base64.b64encode(b"%s:%s" % (_user, _password)).decode("ascii")
headers['Authorization'] = 'Basic {}'.format(valid_uname_pw)
params = dict(width=width, height=height)
url = url + "?" + urllib.urlencode(params)

# @todo annoying but not critical
Expand All @@ -1899,11 +1901,12 @@ def _render_thumbnail(req_body, width=240, height=180):
data = unicode(data, errors='ignore').encode('UTF-8')
try:
req, content = http_client.post(
url, data=data, headers={'Content-type': 'text/html'})
url, data=data, headers=headers)
except BaseException as e:
logger.warning('Error generating thumbnail')
logger.exception(e)
return

return content


Expand Down
25 changes: 14 additions & 11 deletions geonode/layers/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,17 +1074,12 @@ def layer_metadata(
if new_regions is not None:
layer.regions.clear()
layer.regions.add(*new_regions)
layer.category = new_category
layer.save()

the_layer = layer_form.instance
the_layer.save()

up_sessions = UploadSession.objects.filter(layer=the_layer.id)
if up_sessions.count() > 0 and up_sessions[0].user != the_layer.owner:
up_sessions.update(user=the_layer.owner)

Layer.objects.filter(id=the_layer.id).update(
category=new_category
)
up_sessions = UploadSession.objects.filter(layer=layer)
if up_sessions.count() > 0 and up_sessions[0].user != layer.owner:
up_sessions.update(user=layer.owner)

if not ajax:
return HttpResponseRedirect(
Expand Down Expand Up @@ -1444,7 +1439,15 @@ def layer_thumbnail(request, layername):
except BaseException:
image = _render_thumbnail(request.body)

if not image:
is_image = False
if image:
import imghdr
for th in imghdr.tests:
is_image = th(image, None)
if is_image:
break

if not is_image:
return HttpResponse(
content=_('couldn\'t generate thumbnail'),
status=500,
Expand Down
4 changes: 2 additions & 2 deletions geonode/locale/ar/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -6266,8 +6266,8 @@ msgid "GeoNode is an open source platform for sharing geospatial data and maps."
msgstr "GeoNode هو منصة مفتوحة المصدر لتبادل البيانات الجغرافية والخرائط."

#: geonode/templates/index.html:23
msgid "http://docs.geonode.org/en/master/usage"
msgstr "http://docs.geonode.org/en/master/usage"
msgid "http://docs.geonode.org/en/2.10.x/usage"
msgstr "http://docs.geonode.org/en/2.10.x/usage"

#: geonode/templates/index.html:23
msgid "Get Started &raquo;"
Expand Down
4 changes: 2 additions & 2 deletions geonode/locale/de/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -1084,8 +1084,8 @@ msgstr "GeoNode ist eine Open-Source-Plattform zur Veröffentlichung von Geodate

#: geonode/contrib/geosites/site_template/templates/site_index.html:14
#: geonode/contrib/geosites/templates/master_index.html:15 geonode/templates/index.html:23
msgid "http://docs.geonode.org/en/master/usage"
msgstr "http://docs.geonode.org/en/master/usage"
msgid "http://docs.geonode.org/en/2.10.x/usage"
msgstr "http://docs.geonode.org/en/2.10.x/usage"

#: geonode/contrib/geosites/site_template/templates/site_index.html:15
#: geonode/contrib/geosites/templates/master_index.html:16 geonode/templates/index.html:23
Expand Down
2 changes: 1 addition & 1 deletion geonode/locale/el/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ msgstr ""
#: geonode/contrib/geosites/site_template/templates/site_index.html:14
#: geonode/contrib/geosites/templates/master_index.html:15
#: geonode/templates/index.html:23
msgid "http://docs.geonode.org/en/master/usage"
msgid "http://docs.geonode.org/en/2.10.x/usage"
msgstr ""

#: geonode/contrib/geosites/site_template/templates/site_index.html:15
Expand Down
2 changes: 1 addition & 1 deletion geonode/locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -7827,7 +7827,7 @@ msgid "home"
msgstr ""

#: geonode/templates/index.html:23
msgid "http://docs.geonode.org/en/master/usage"
msgid "http://docs.geonode.org/en/2.10.x/usage"
msgstr ""

#: geonode/templates/index.html:23
Expand Down
Binary file modified geonode/locale/es/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit f41c355

Please sign in to comment.