[Fixes #14155] Fixes parameter order for mdict to set precedence from settings.PYCSW to pycsw_local defaults#14161
[Fixes #14155] Fixes parameter order for mdict to set precedence from settings.PYCSW to pycsw_local defaults#14161cmotadev wants to merge 54 commits intoGeoNode:masterfrom
Conversation
(cherry picked from commit a492be2)
(cherry picked from commit 1ddae09)
…PATH value in settings
(cherry picked from commit 281e984)
(cherry picked from commit 36654b9) Co-authored-by: Mattia <mattia.giupponi@gmail.com>
* Some cleanup to settings --------- (cherry picked from commit 5726abc) Co-authored-by: Giovanni Allegri <giohappy@gmail.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: Mattia <mattia.giupponi@gmail.com>
* build(deps): bump django from 5.2.7 to 5.2.8 Bumps [django](https://github.com/django/django) from 5.2.7 to 5.2.8. - [Commits](django/django@5.2.7...5.2.8) --- updated-dependencies: - dependency-name: django dependency-version: 5.2.8 dependency-type: direct:production ... * align setup.cfg --------- (cherry picked from commit 04d440e) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mattiagiupponi <51856725+mattiagiupponi@users.noreply.github.com>
* feat: Add project-specific fixture loading configuration * fix: code linting * Simplify error message formatting for fixture loading --------- (cherry picked from commit 6953eb9) Co-authored-by: Niraj Adhikari <41701707+nrjadkry@users.noreply.github.com> Co-authored-by: Giovanni Allegri <giohappy@gmail.com>
) * adding Beat in a separate process * avoid restarting * defining a restart policy to the celery container * avoid PID conflicts which make Celery container to enter in a restart loop * removing starting policy from the Celery service itself (cherry picked from commit 5e1f441) Co-authored-by: George Petrakis <gkpetrak@gmail.com>
(cherry picked from commit 6385c7a) Co-authored-by: allyoucanmap <stefano.bovio@geosolutionsgroup.com>
(cherry picked from commit cc94699) Co-authored-by: G.Allegri <giohappy@gmail.com>
(cherry picked from commit 105ea13)
* Update Django version to 5.2.10 * Update Django version to 5.2.10
) (#13941) Ensure GeoJSON files containing non-ASCII (e.g. Chinese) attribute values are correctly detected and validated by explicitly decoding input as UTF-8 in GeoJsonFileHandler. This prevents false negatives in handler detection and avoids incorrectly reporting valid GeoJSON files as invalid due to implicit or system-dependent encoding assumptions. (cherry picked from commit d93a30d) Co-authored-by: F0rtiter <40894236+F0rtiter@users.noreply.github.com>
* Update Django version to 5.2.12
#13991) (#14056) * [Fixes #13990] Basic auth is not fully propagated into the WMS Service * Update geonode/services/serviceprocessors/wms.py * Update geonode/services/views.py * Update geonode/services/views.py * [Fixes #13990] Basic auth is not fully propagated into the WMS Service * [Fixes #13990] Basic auth is not fully propagated into the WMS Service --------- (cherry picked from commit ca8e960) Co-authored-by: mattiagiupponi <51856725+mattiagiupponi@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
(cherry picked from commit 9b91659) Co-authored-by: mattiagiupponi <51856725+mattiagiupponi@users.noreply.github.com>
… a replace on the… (#14063)
… settings.PYCSW to pycsw_local defaults. Now it's possible to overwrite PyCSW parameterrs from settings
|
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @github-actions[bot] on file. In order for us to review and merge your code, please contact the project maintainers to get yourself added. |
There was a problem hiding this comment.
Code Review
This pull request introduces extensive updates to the GeoNode ecosystem, including dependency upgrades for Django, Pillow, and urllib3, alongside updating Geoserver images to version 2.27.4. Significant security enhancements were made to the upload process by transitioning ogr2ogr command execution to a list-based Popen implementation with proper shell quoting. The PR also refactors settings management, improves permissions cache invalidation, and adds a new AdvertisedFilter for resource visibility. Review feedback identifies a critical dictionary iteration bug in the vector handler, suggests using BigIntegerField for Integer64 to avoid precision loss, recommends simplifying the advertised filter logic, and advises replacing a deprecated Pillow method in EXIF metadata extraction.
| feature_to_save = [] | ||
| for feature in data_chunk: | ||
| feature_as_dict = feature.items() | ||
| feature_as_dict = {self.fixup_name(key): value for key, value in feature.items().items()} |
There was a problem hiding this comment.
feature.items() returns a dictionary. Calling .items() on it again is incorrect and will raise an AttributeError. You should iterate directly over the dictionary returned by feature.items().
| feature_as_dict = {self.fixup_name(key): value for key, value in feature.items().items()} | |
| feature_as_dict = {self.fixup_name(key): value for key, value in feature.items()} |
|
|
||
| STANDARD_TYPE_MAPPING = { | ||
| "Integer64": "django.db.models.IntegerField", | ||
| "Integer64": "django.db.models.FloatField", |
There was a problem hiding this comment.
Mapping Integer64 to FloatField can lead to loss of precision for large integer values. It would be more appropriate to map it to django.db.models.BigIntegerField to ensure large integers are stored correctly without precision loss.
| "Integer64": "django.db.models.FloatField", | |
| "Integer64": "django.db.models.BigIntegerField", |
| except Exception: | ||
| advertised = None | ||
|
|
||
| if advertised == "all": | ||
| pass | ||
| elif advertised is not None: | ||
| queryset = queryset.filter(advertised=advertised) | ||
| else: | ||
| is_admin = user.is_superuser if user and user.is_authenticated else False | ||
| if not is_admin and user and not user.is_anonymous: | ||
| queryset = (queryset.filter(advertised=True) | queryset.filter(owner=user)).distinct() | ||
| elif not user or user.is_anonymous: | ||
| queryset = queryset.filter(advertised=True) |
There was a problem hiding this comment.
The logic for filtering based on user type can be simplified for better readability. Also, it's better to catch a more specific ValueError from strtobool instead of a generic Exception.
| except Exception: | |
| advertised = None | |
| if advertised == "all": | |
| pass | |
| elif advertised is not None: | |
| queryset = queryset.filter(advertised=advertised) | |
| else: | |
| is_admin = user.is_superuser if user and user.is_authenticated else False | |
| if not is_admin and user and not user.is_anonymous: | |
| queryset = (queryset.filter(advertised=True) | queryset.filter(owner=user)).distinct() | |
| elif not user or user.is_anonymous: | |
| queryset = queryset.filter(advertised=True) | |
| except ValueError: | |
| advertised = None | |
| if advertised == "all": | |
| pass | |
| elif advertised is not None: | |
| queryset = queryset.filter(advertised=advertised) | |
| else: | |
| if user.is_superuser: | |
| # Superusers can see all resources, so no additional filter is applied. | |
| pass | |
| elif user.is_authenticated: | |
| queryset = (queryset.filter(advertised=True) | queryset.filter(owner=user)).distinct() | |
| else: # Anonymous user | |
| queryset = queryset.filter(advertised=True) |
|
|
||
| img = Image.open(doc.doc_file.path) | ||
| img = Image.open(file_path) | ||
| exif_data = {ExifTags.TAGS[k]: v for k, v in img._getexif().items() if k in ExifTags.TAGS} |
There was a problem hiding this comment.
The _getexif() method is considered internal and is deprecated in Pillow. It's better to use the public getexif() method, which is available in recent versions of Pillow and returns an Exif object that behaves like a dictionary.
| exif_data = {ExifTags.TAGS[k]: v for k, v in img._getexif().items() if k in ExifTags.TAGS} | |
| exif_data = {ExifTags.TAGS[k]: v for k, v in img.getexif().items() if k in ExifTags.TAGS} |
|
My apologies, I will merge to master first |
Now it's possible to overwrite PyCSW parameterrs from settings and view mods in pyCSW GetCapabilites
Checklist
For all pull requests:
The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):
Submitting the PR does not require you to check all items, but by the time it gets merged, they should be either satisfied or inapplicable.