udata 10.1.3.dev34179__py2.py3-none-any.whl → 10.1.3.dev34195__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of udata might be problematic. Click here for more details.
- udata/features/transfer/api.py +7 -4
- udata/static/chunks/{10.8ca60413647062717b1e.js → 10.471164b2a9fe15614797.js} +3 -3
- udata/static/chunks/{10.8ca60413647062717b1e.js.map → 10.471164b2a9fe15614797.js.map} +1 -1
- udata/static/chunks/{11.33f00815743ef2ea9e06.js → 11.55ab79044cda0271b595.js} +3 -3
- udata/static/chunks/{11.33f00815743ef2ea9e06.js.map → 11.55ab79044cda0271b595.js.map} +1 -1
- udata/static/chunks/{19.8d03c06efcac6884bebe.js → 19.3e0e8651d948e04b8cf2.js} +3 -3
- udata/static/chunks/{19.8d03c06efcac6884bebe.js.map → 19.3e0e8651d948e04b8cf2.js.map} +1 -1
- udata/static/chunks/{8.0b54a9e3084c9636c58f.js → 8.494b003a94383b142c18.js} +2 -2
- udata/static/chunks/{8.0b54a9e3084c9636c58f.js.map → 8.494b003a94383b142c18.js.map} +1 -1
- udata/static/chunks/{9.033d7e190ca9e226a5d0.js → 9.07515e5187f475bce828.js} +3 -3
- udata/static/chunks/{9.033d7e190ca9e226a5d0.js.map → 9.07515e5187f475bce828.js.map} +1 -1
- udata/static/common.js +1 -1
- udata/static/common.js.map +1 -1
- udata/tests/api/test_transfer_api.py +38 -0
- {udata-10.1.3.dev34179.dist-info → udata-10.1.3.dev34195.dist-info}/METADATA +2 -2
- {udata-10.1.3.dev34179.dist-info → udata-10.1.3.dev34195.dist-info}/RECORD +20 -20
- {udata-10.1.3.dev34179.dist-info → udata-10.1.3.dev34195.dist-info}/LICENSE +0 -0
- {udata-10.1.3.dev34179.dist-info → udata-10.1.3.dev34195.dist-info}/WHEEL +0 -0
- {udata-10.1.3.dev34179.dist-info → udata-10.1.3.dev34195.dist-info}/entry_points.txt +0 -0
- {udata-10.1.3.dev34179.dist-info → udata-10.1.3.dev34195.dist-info}/top_level.txt +0 -0
udata/features/transfer/api.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from flask import request
|
|
1
|
+
from flask import abort, request
|
|
2
2
|
|
|
3
3
|
from udata.api import API, api, base_reference, fields
|
|
4
4
|
from udata.core.dataservices.models import Dataservice
|
|
@@ -27,7 +27,7 @@ transfer_request_fields = api.model(
|
|
|
27
27
|
"recipient": fields.Nested(
|
|
28
28
|
base_reference,
|
|
29
29
|
required=True,
|
|
30
|
-
description=("The transfer recipient,
|
|
30
|
+
description=("The transfer recipient, either an user or an organization"),
|
|
31
31
|
),
|
|
32
32
|
"comment": fields.String(
|
|
33
33
|
description="An explanation about the transfer request", required=True
|
|
@@ -68,12 +68,12 @@ transfer_fields = api.model(
|
|
|
68
68
|
"owner": fields.Polymorph(
|
|
69
69
|
person_mapping,
|
|
70
70
|
readonly=True,
|
|
71
|
-
description=("The user or organization currently owning
|
|
71
|
+
description=("The user or organization currently owning the transfered object"),
|
|
72
72
|
),
|
|
73
73
|
"recipient": fields.Polymorph(
|
|
74
74
|
person_mapping,
|
|
75
75
|
readonly=True,
|
|
76
|
-
description=("The user or organization receiving
|
|
76
|
+
description=("The user or organization receiving the transfered object"),
|
|
77
77
|
),
|
|
78
78
|
"subject": fields.Polymorph(
|
|
79
79
|
subject_mapping, readonly=True, description="The transfered object"
|
|
@@ -186,6 +186,9 @@ class TransferRequestAPI(API):
|
|
|
186
186
|
"""Respond to a transfer request"""
|
|
187
187
|
transfer = Transfer.objects.get_or_404(id=id_or_404(id))
|
|
188
188
|
|
|
189
|
+
if transfer.status != "pending":
|
|
190
|
+
abort(400, "Cannot update transfer after accepting/refusing")
|
|
191
|
+
|
|
189
192
|
data = request.json
|
|
190
193
|
comment = data.get("comment")
|
|
191
194
|
|