-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 #10270] Document creation via API v2 #10271
Merged
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
eb7843a
[Fixes #10270] Document creation via API v2
mattiagiupponi 03f840b
[Fixes #10270] Document creation via API v2
mattiagiupponi 17c29c3
Merge branch 'master' into ISSUE_10270
mattiagiupponi a382721
[Fixes #10270] Document creation via API v2
mattiagiupponi 65781e1
Merge branch 'master' into ISSUE_10270
afabiani 54f6075
Merge branch 'master' of github.com:GeoNode/geonode into ISSUE_10270
mattiagiupponi 252b16c
[Fixes #10270] Document creation via API v2
mattiagiupponi a61d7fb
Merge branch 'master' into ISSUE_10270
mattiagiupponi f39de60
[Fixes #10270] Document creation via API v2
mattiagiupponi dd61c23
[Fixes #10270] Document creation via API v2
mattiagiupponi 28ae5bc
[Fixes #10270] Document creation via API v2
mattiagiupponi 4217394
Merge branch 'master' into ISSUE_10270
mattiagiupponi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Generated by Django 3.2.16 on 2022-11-08 10:52 | ||
|
||
from django.db import migrations, models | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('base', '0084_remove_comments_from_actions'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='resourcebase', | ||
name='uuid', | ||
field=models.CharField(default=uuid.uuid4, max_length=36, unique=True), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
######################################################################### | ||
# | ||
# Copyright (C) 2022 OSGeo | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
######################################################################### | ||
from rest_framework.exceptions import APIException | ||
|
||
|
||
class DocumentException(APIException): | ||
status_code = 400 | ||
default_detail = "invalid document" | ||
default_code = "document_exception" | ||
category = "document_api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@afabiani this fix is needed since the last migration available for the UUID, is marked as a string of the function itself and not a result.
geonode/geonode/base/migrations/0080_alter_resourcebase_uuid.py
Line 17 in a41fbfd
This end-up up having an error because the system tries to save the UUID as a "function of...."
This fix, will let geonode decide the UUID (as object) and the fix in the save_method below, helps it to convert it to string if needed