geonode
geonode copied to clipboard
[Fixes #11703] Documents can now be uploaded without specifying title via the REST API.
Fixes#11703 Upload document via REST API v2 does not work
The document upload does not work without specifying the title. With this PR the document will be uploaded while setting the title as the name of the uploaded file.
Checklist
Reviewing is a process done by project maintainers, mostly on a volunteer basis. We try to keep the overhead as small as possible and appreciate if you help us to do so by completing the following items. Feel free to ask in a comment if you have troubles with any of them.
For all pull requests:
- [x] Confirm you have read the contribution guidelines
- [x] You have sent a Contribution Licence Agreement (CLA) as necessary (not required for small changes, e.g., fixing typos in the documentation)
- [x] Make sure the first PR targets the master branch, eventual backports will be managed later. This can be ignored if the PR is fixing an issue that only happens in a specific branch, but not in newer ones.
The following are required only for core and extension modules (they are welcomed, but not required, for contrib modules):
- [x] There is a ticket in https://github.com/GeoNode/geonode/issues describing the issue/improvement/feature (a notable exemption is, changes not visible to end-users)
- [ ] The issue connected to the PR must have Labels and Milestone assigned
- [x] PR for bug fixes and small new features are presented as a single commit
- [ ] Commit message must be in the form "[Fixes #<issue_number>] Title of the Issue"
- [ ] New unit tests have been added covering the changes, unless there is an explanation on why the tests are not necessary/implemented
- [x] This PR passes all existing unit tests (test results will be reported by travis-ci after opening this PR)
- [x] This PR passes the QA checks: black geonode && flake8 geonode
- [x] Commits changing the settings, UI, existing user workflows, or adding new functionality, need to include documentation updates
- [x] Commits adding new texts do use gettext and have updated .po / .mo files (without location infos)
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.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 64.23%. Comparing base (
f8dabd5
) to head (b0c883a
).
Additional details and impacted files
@@ Coverage Diff @@
## master #11872 +/- ##
=======================================
Coverage 64.22% 64.23%
=======================================
Files 888 888
Lines 53551 53562 +11
Branches 6605 6605
=======================================
+ Hits 34392 34403 +11
Misses 17650 17650
Partials 1509 1509
@ahmdthr please take a look at the failing tests.
Apparently your test is failing
Sorry for the late response, but I was sick last week. I am going to fix the issues today. Thank you for waiting.
⚠️ GitGuardian has uncovered 4 secrets following the scan of your pull request.
Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.
Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard. Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.
🔎 Detected hardcoded secrets in your pull request
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
59204 | Triggered | Django Secret Key | 684782539181a0900e1f41376350b19fae6eeafd | .devcontainer/.env | View secret |
59204 | Triggered | Django Secret Key | 684782539181a0900e1f41376350b19fae6eeafd | .env_local | View secret |
59204 | Triggered | Django Secret Key | 684782539181a0900e1f41376350b19fae6eeafd | .env_dev | View secret |
9705160 | Triggered | Username Password | 684782539181a0900e1f41376350b19fae6eeafd | geonode/base/api/tests.py | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
test are failing again @ahmdthr
@giohappy The tests are fine now. The tests were failing after the introduction of "Assets". It can also be back-ported to 4.3, if needed.
@ahmdthr what do you think of setting the file name instead of None in case the title is missing?