Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fixes #6952] Layer UUID handler #6953

Merged
merged 32 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
f654111
Merge pull request #626 from geosolutions-it/merge_from_upsteram
giohappy Jan 20, 2021
0df9357
Merge branch 'master' of https://github.com/GeoNode/geonode
allyoucanmap Feb 1, 2021
2a11ead
Bump urllib3 from 1.26.2 to 1.26.3 (#6908)
dependabot[bot] Feb 2, 2021
040772e
[Fixes #6880] Circle CI upload tests fail irregulary (#6881)
t-book Feb 2, 2021
65c6267
[Fixes #6914] Remove "add to basket" tool for documents and maps (#6915)
Feb 2, 2021
158511a
Added malnajdi as contributor
t-book Feb 2, 2021
e9efc3d
[Fixes #6910] meaningful filename for document download (#6911)
gannebamm Feb 2, 2021
91f1a4e
- CircleCI Upload Tests: trying to reduce more the risk of infinite …
afabiani Feb 2, 2021
5e77b39
[Fixes #6916] gsimporter.api.NotFound caused by missing trailing slas…
malnajdi Feb 3, 2021
ec6d728
Bump django-cors-headers from 3.6.0 to 3.7.0 (#6901)
dependabot[bot] Feb 3, 2021
c5432b5
Bump amqp from 5.0.3 to 5.0.5 (#6905)
dependabot[bot] Feb 3, 2021
28424ca
Bump pip from 21.0 to 21.0.1 (#6900)
dependabot[bot] Feb 3, 2021
be313d5
Bump coverage from 5.3.1 to 5.4 (#6903)
dependabot[bot] Feb 3, 2021
f073274
Bump pytest from 6.2.1 to 6.2.2 (#6907)
dependabot[bot] Feb 3, 2021
9a3913e
Bump djangorestframework-gis from 0.16 to 0.17 (#6902)
dependabot[bot] Feb 3, 2021
ae6f6c1
- Algin setup.cfg to requirements.txt
afabiani Feb 3, 2021
0dad216
[Fixes #6922][REST API v2] Expose the curated thumbnail URL if it has…
Feb 3, 2021
30910b2
[Fixes #6918] Removal of QGIS support (#6919)
Feb 3, 2021
dbb4ac0
Merge branch 'master' of https://github.com/GeoNode/geonode
Feb 4, 2021
0bcf2fb
allow Basic authenticated requests in LOCKDOWN mode
bieganowski Feb 5, 2021
af22a3c
fix to avoid circular import
bieganowski Feb 5, 2021
c7ede4f
flake8 check fix
bieganowski Feb 5, 2021
b557f6d
added tests
bieganowski Feb 5, 2021
0a82a14
Merge pull request #652 from geosolutions-it/feature#650_basic_auth_m…
Feb 5, 2021
38c7241
Add uuid handler setting
mattiagiupponi Feb 8, 2021
5a08c8a
Add pluggable LAYER_UUID_HANDLER
mattiagiupponi Feb 10, 2021
cecb348
Typo removed from settings.py
mattiagiupponi Feb 10, 2021
36c28d6
Fix flake8 indentation in layer_utis
mattiagiupponi Feb 10, 2021
12c4f78
Resolves #665: add uuid as exposed parameter in api
mattiagiupponi Feb 15, 2021
ce20d4d
Merge remote-tracking branch 'upstream/master' into layer_uuid_handler
mattiagiupponi Feb 15, 2021
bb65e04
Fixes #6952: add smoketest to show how uuidhanlder works
mattiagiupponi Feb 16, 2021
8416a9c
Merge branch 'master' into layer_uuid_handler
Feb 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions geonode/api/resourcebase_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class CommonMetaApi:
'owner': ALL_WITH_RELATIONS,
'date': ALL,
'purpose': ALL,
'uuid': ALL_WITH_RELATIONS,
'abstract': ALL
}
ordering = ['date', 'title', 'popular_count']
Expand Down
10 changes: 8 additions & 2 deletions geonode/layers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,14 @@ def pre_save_layer(instance, sender, **kwargs):
if instance.owner is None:
instance.owner = get_valid_user()

if instance.uuid == '':
instance.uuid = str(uuid.uuid1())
logger.debug("handling UUID In pre_save_layer")
if hasattr(settings, 'LAYER_UUID_HANDLER') and settings.LAYER_UUID_HANDLER != '':
logger.debug("using custom uuid handler In pre_save_layer")
from geonode.layers.utils import get_uuid_handler
instance.uuid = get_uuid_handler()(instance).create_uuid()
else:
if instance.uuid == '':
instance.uuid = str(uuid.uuid1())

logger.debug("In pre_save_layer")
if instance.alternate is None:
Expand Down
5 changes: 5 additions & 0 deletions geonode/layers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1388,3 +1388,8 @@ def set_layers_permissions(permissions_name, resources_names=None,
if verbose:
logger.info("Permissions successfully updated!")
print("Permissions successfully updated!")


def get_uuid_handler():
from django.utils.module_loading import import_string
return import_string(settings.LAYER_UUID_HANDLER)
1 change: 1 addition & 0 deletions geonode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -2122,3 +2122,4 @@ def get_geonode_catalogue_service():
# -- END Settings for MONITORING plugin

CATALOG_METADATA_TEMPLATE = os.getenv("CATALOG_METADATA_TEMPLATE", "catalogue/full_metadata.xml")