Skip to content

Commit

Permalink
[Fixes #6966] Thesauri intial data (#6967)
Browse files Browse the repository at this point in the history
* Bump urllib3 from 1.26.2 to 1.26.3 (#6908)

Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.2 to 1.26.3.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/1.26.3/CHANGES.rst)
- [Commits](urllib3/urllib3@1.26.2...1.26.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Toni <toni.schoenbuchner@csgis.de>

* [Fixes #6880] Circle CI upload tests fail irregulary (#6881)

* [Fixes #6880] Circle CI upload tests fail irregulary

* CircleCI test fix: sometimes expires due to upload timeout in the test environment

* - Avoid infinite loop on upload testing

* Revert "CircleCI test fix: sometimes expires due to upload timeout in the test environment"

This reverts commit 66139fd.

Co-authored-by: Alessio Fabiani <alessio.fabiani@geo-solutions.it>
Co-authored-by: afabiani <alessio.fabiani@gmail.com>

* [Fixes #6914] Remove "add to basket" tool for documents and maps (#6915)

* Added malnajdi as contributor

* [Fixes #6910] meaningful filename for document download (#6911)

* get meaningful document filenames on download

* - Strip extension from document title before slugify it (e.g.: image.jpg instead of imagejpg.jpg)

Co-authored-by: afabiani <alessio.fabiani@gmail.com>
Co-authored-by: Alessio Fabiani <alessio.fabiani@geo-solutions.it>

* - CircleCI Upload Tests: trying to reduce more the risk of infinite loop on "wait_for_progress"

* [Fixes #6916] gsimporter.api.NotFound caused by missing trailing slash at the end of GEOSERVER_LOCATION (#6913)

* [Fixes #6916] gsimporter.api.NotFound caused by missing trailing slash at the end of GEOSERVER_LOCATION

* [Fixes #6916] unit test for GEOSERVER_LOCATION

* Bump django-cors-headers from 3.6.0 to 3.7.0 (#6901)

Bumps [django-cors-headers](https://github.com/adamchainz/django-cors-headers) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/adamchainz/django-cors-headers/releases)
- [Changelog](https://github.com/adamchainz/django-cors-headers/blob/master/HISTORY.rst)
- [Commits](adamchainz/django-cors-headers@3.6.0...3.7.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump amqp from 5.0.3 to 5.0.5 (#6905)

Bumps [amqp](https://github.com/celery/py-amqp) from 5.0.3 to 5.0.5.
- [Release notes](https://github.com/celery/py-amqp/releases)
- [Changelog](https://github.com/celery/py-amqp/blob/master/Changelog)
- [Commits](celery/py-amqp@v5.0.3...v5.0.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pip from 21.0 to 21.0.1 (#6900)

Bumps [pip](https://github.com/pypa/pip) from 21.0 to 21.0.1.
- [Release notes](https://github.com/pypa/pip/releases)
- [Changelog](https://github.com/pypa/pip/blob/master/NEWS.rst)
- [Commits](pypa/pip@21.0...21.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump coverage from 5.3.1 to 5.4 (#6903)

Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.3.1 to 5.4.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](nedbat/coveragepy@coverage-5.3.1...coverage-5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump pytest from 6.2.1 to 6.2.2 (#6907)

Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@6.2.1...6.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump djangorestframework-gis from 0.16 to 0.17 (#6902)

Bumps [djangorestframework-gis](https://github.com/openwisp/django-rest-framework-gis) from 0.16 to 0.17.
- [Release notes](https://github.com/openwisp/django-rest-framework-gis/releases)
- [Changelog](https://github.com/openwisp/django-rest-framework-gis/blob/master/CHANGES.rst)
- [Commits](openwisp/django-rest-framework-gis@v0.16.0...v0.17.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* - Algin setup.cfg to requirements.txt

* [Fixes #6922][REST API v2] Expose the curated thumbnail URL if it has… (#6923)

* [Fixes #6922][REST API v2] Expose the curated thumbnail URL if it has been uploaded

* - Add REST APIs test suite to CircleCI

* [Fixes #6918] Removal of QGIS support (#6919)

* [Cleanup and Refactor] Remove QGIS server backend dependencies

* [Cleanup and Refactor] Remove QGIS server backend dependencies

* - Fix LGTM issues

* allow Basic authenticated requests in LOCKDOWN mode

* fix to avoid circular import

* flake8 check fix

* added tests

* Fixes #6966: fix initial data for thesaurus, add custom data for test purposes, fix tests

* Fixes #6966: fix flake8 syntax

* Fixes #6966: thesaurus removed from initial_data.json

Co-authored-by: Giovanni Allegri <giohappy@gmail.com>
Co-authored-by: allyoucanmap <bovio.stefano@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Toni <toni.schoenbuchner@csgis.de>
Co-authored-by: Alessio Fabiani <alessio.fabiani@geo-solutions.it>
Co-authored-by: afabiani <alessio.fabiani@gmail.com>
Co-authored-by: Florian Hoedt <gannebamm@gmail.com>
Co-authored-by: Mohammed Y. Alnajdi <mohdnagfy@gmail.com>
Co-authored-by: biegan <bieganowski.rev@gmail.com>
  • Loading branch information
10 people committed Feb 22, 2021
1 parent 7e1b7a0 commit 849d334
Show file tree
Hide file tree
Showing 4 changed files with 651 additions and 269 deletions.
5 changes: 4 additions & 1 deletion geonode/base/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@

from django import forms

from django.conf import settings


class MultiThesauriField(forms.ModelMultipleChoiceField):

def label_from_instance(self, obj):
# Note: Not using .get() because filter()[0] is used in original
# code. The hard-coded language is currently used throughout
# geonode.
return obj.keyword.filter(lang='en').first().label
lang = settings.THESAURUS_DEFAULT_LANG if hasattr(settings, "THESAURUS_DEFAULT_LANG") else "en"
return obj.keyword.filter(lang=lang).first().label
266 changes: 1 addition & 265 deletions geonode/base/fixtures/initial_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -4852,269 +4852,5 @@
"fields": {
"name": "TOPBAR_MENU"
}
},
{
"model": "base.thesaurus",
"pk": 1,
"fields": {
"identifier": "inspire_themes",
"title": "GEMET - INSPIRE themes, version 1.0",
"date": "2018-05-23T10:25:56",
"description": "GEMET - INSPIRE themes, version 1.0",
"slug": "",
"about": "http://inspire.ec.europa.eu/theme",
"card_min": 1,
"card_max": 0,
"facet": true
}
},
{
"model": "base.thesaurus",
"pk": 4,
"fields": {
"identifier": "abc-all1",
"title": "Register of data of general interest",
"date": "2018-06-25",
"description": "Register of data of general interest",
"slug": "",
"about": "https://registry.geodati.gov.it/abc-all1",
"card_min": 0,
"card_max": 1,
"facet": true
}
},
{
"model": "base.thesaurus",
"pk": 6,
"fields": {
"identifier": "limitation_on_public_access",
"title": "Limitations on public access",
"date": "2020-10-22T13:21:33",
"description": "Limitations on public access",
"slug": "",
"about": "http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess",
"card_min": 1,
"card_max": 1,
"facet": true
}
},
{
"model": "base.thesaurus",
"pk": 7,
"fields": {
"identifier": "limitation_on_public_access-2",
"title": "Conditions Applying To Access and Use",
"date": "2020-10-30T16:58:34",
"description": "Conditions Applying To Access and Use",
"slug": "",
"about": "http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse",
"card_min": 0,
"card_max": -1,
"facet": true
}
},
{
"model": "base.thesaurus",
"pk": 8,
"fields": {
"identifier": "foo_name",
"title": "Mocked Title",
"date": "2018-05-23T10:25:56",
"description": "Mocked Title",
"slug": "abc",
"about": "http://inspire.ec.europa.eu/theme",
"card_min": 1,
"card_max": -1,
"facet": true
}
},
{
"model": "base.thesauruskeyword",
"pk": 1,
"fields": {
"about": "http://inspire.ec.europa.eu/theme/ad",
"alt_label": "ad",
"thesaurus": 1
}
},
{
"model": "base.thesauruskeyword",
"pk": 2,
"fields": {
"about": "http://inspire.ec.europa.eu/theme/au",
"alt_label": "au",
"thesaurus": 1
}
},
{
"model": "base.thesauruskeyword",
"pk": 3,
"fields": {
"about": "http://inspire.ec.europa.eu/theme/rs",
"alt_label": "rs",
"thesaurus": 1
}
},
{
"model": "base.thesauruskeyword",
"pk": 35,
"fields": {
"about": "http://inspire.ec.europa.eu/metadata-codelist/LimitationsOnPublicAccess/INSPIRE_Directive_Article13_1a",
"alt_label": "public access limited according to Article 13(1)(a) of the INSPIRE Directive [ITA]",
"thesaurus": 6
}
},
{
"model": "base.thesauruskeyword",
"pk": 44,
"fields": {
"about": "http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/noConditionsApply",
"alt_label": "No condition applicable",
"thesaurus": 7
}
},
{
"model": "base.thesauruskeyword",
"pk": 45,
"fields": {
"about": "http://inspire.ec.europa.eu/metadata-codelist/ConditionsApplyingToAccessAndUse/conditionsUnknown",
"alt_label": "Unknown Conditions",
"thesaurus": 7
}
},
{
"model": "base.thesauruskeyword",
"pk": 100,
"fields": {
"about": "http://test.com",
"alt_label": "Protected sites",
"thesaurus": 8
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 1,
"fields": {
"lang": "en",
"label": "Addresses",
"keyword": 1
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 2,
"fields": {
"lang": "de",
"label": "Adressen",
"keyword": 1
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 3,
"fields": {
"lang": "en",
"label": "Administrative units",
"keyword": 2
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 4,
"fields": {
"lang": "en",
"label": "Coordinate reference systems",
"keyword": 3
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 36,
"fields": {
"lang": "en",
"label": "public access limited according to Article 13(1)(a) of the INSPIRE Directive",
"keyword": 35
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 54,
"fields": {
"lang": "en",
"label": "no conditions to access and use",
"keyword": 44
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 56,
"fields": {
"lang": "en",
"label": "conditions to access and use unknown",
"keyword": 45
}
},
{
"model": "base.thesauruskeywordlabel",
"pk": 102,
"fields": {
"lang": "en",
"label": "Protected sites",
"keyword": 100
}
},
{
"model": "base.thesauruslabel",
"pk": 1,
"fields": {
"lang": "en",
"label": "Addresses",
"thesaurus": 1
}
},
{
"model": "base.thesauruslabel",
"pk": 2,
"fields": {
"lang": "de",
"label": "Adressen",
"thesaurus": 1
}
},
{
"model": "base.thesauruslabel",
"pk": 4,
"fields": {
"lang": "en",
"label": "Register of the reference data sets",
"thesaurus": 4
}
},
{
"model": "base.thesauruslabel",
"pk": 5,
"fields": {
"lang": "en",
"label": "Limitations on public access",
"thesaurus": 6
}
},
{
"model": "base.thesauruslabel",
"pk": 7,
"fields": {
"lang": "en",
"label": "Conditions Applying To Access and Use",
"thesaurus": 7
}
},
{
"model": "base.thesauruslabel",
"pk": 9,
"fields": {
"lang": "en",
"label": "Register of the reference data sets",
"thesaurus": 8
}
}
}
]
Loading

0 comments on commit 849d334

Please sign in to comment.