diff --git a/geonode/base/api/serializers.py b/geonode/base/api/serializers.py index 993491c067c..2499ee076ce 100644 --- a/geonode/base/api/serializers.py +++ b/geonode/base/api/serializers.py @@ -675,7 +675,7 @@ def __init__(self, *args, **kwargs): self.fields["edition"] = serializers.CharField(required=False) self.fields["purpose"] = serializers.CharField(required=False) self.fields["maintenance_frequency"] = serializers.CharField(required=False) - self.fields["constraints_other"] = serializers.CharField(required=False) + self.fields["language"] = serializers.CharField(required=False) self.fields["supplemental_information"] = serializers.CharField(required=False) self.fields["data_quality_statement"] = serializers.CharField(required=False) diff --git a/geonode/base/models.py b/geonode/base/models.py index 3cba28b3667..06ad2392b04 100644 --- a/geonode/base/models.py +++ b/geonode/base/models.py @@ -791,10 +791,13 @@ class ResourceBase(PolymorphicModel, PermissionLevelMixin, ItemBase): use_constraints_help_text = _( "This metadata element shall provide information on the Use constraints applied to assure the protection of privacy or intellectual property (e.g. Trademark)" ) - restriction_other_help_text = _("limitation(s) placed upon the access or use of the data.") + use_constraint_restrictions_help_text = _("limitation(s) placed upon the access or use of the data by Admin.") + use_constraints_help_text = _("limitation(s) placed upon the access or use of the data by Admin.") + restriction_other_help_text = _("limitation(s) placed upon the access or use of the data by User.") constraints_other_help_text = _( - "other restrictions and legal prerequisites for accessing and using the resource or" " metadata" + "other restrictions and legal prerequisites for accessing and using the resource or metadata by User" ) + license_help_text = _("license of the dataset") metadata_license_help_text = _("license of the metadata") language_help_text = _("language used within the dataset") @@ -959,9 +962,12 @@ class ResourceBase(PolymorphicModel, PermissionLevelMixin, ItemBase): verbose_name=_("Use Constrain Restrictions"), null=True, blank=True, + help_text=use_constraint_restrictions_help_text, ) - use_constraints = models.TextField(_("Use Constraints"), null=True, blank=True) + use_constraints = models.TextField( + _("Use Constraints"), null=True, blank=True, help_text=constraints_other_help_text + ) restriction_other = models.ManyToManyField( RestrictionCodeType, verbose_name=_("restrictions"), diff --git a/geonode/layers/views.py b/geonode/layers/views.py index 6381d63759f..b10c03196fc 100644 --- a/geonode/layers/views.py +++ b/geonode/layers/views.py @@ -647,6 +647,14 @@ def dataset_metadata( layer.regions.add(*new_regions) layer.category = new_category + use_constraint_restrictions = [x for x in dataset_form.cleaned_data["use_constraint_restrictions"]] + if use_constraint_restrictions: + layer.use_constraint_restrictions.add(*use_constraint_restrictions) + + restriction_other = [x for x in dataset_form.cleaned_data["restriction_other"]] + if restriction_other: + layer.restriction_other.add(*restriction_other) + from geonode.upload.models import Upload up_sessions = Upload.objects.filter(resource_id=layer.resourcebase_ptr_id) diff --git a/geonode/settings.py b/geonode/settings.py index f16b771b3c9..3944255d1d8 100644 --- a/geonode/settings.py +++ b/geonode/settings.py @@ -2165,7 +2165,6 @@ def get_geonode_catalogue_service(): "id_resource-date", "category_form", "id_resource-attribution", - "id_resource-constraints_other", "id_resource-data_quality_statement", ] UI_REQUIRED_FIELDS = ast.literal_eval(os.getenv("UI_REQUIRED_FIELDS ", "[]"))