udata 10.4.1.dev35182__py2.py3-none-any.whl → 10.4.1.dev35201__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/core/dataset/apiv2.py +1 -1
- udata/core/followers/api.py +5 -1
- udata/tests/api/test_datasets_api.py +24 -0
- {udata-10.4.1.dev35182.dist-info → udata-10.4.1.dev35201.dist-info}/METADATA +3 -1
- {udata-10.4.1.dev35182.dist-info → udata-10.4.1.dev35201.dist-info}/RECORD +9 -9
- {udata-10.4.1.dev35182.dist-info → udata-10.4.1.dev35201.dist-info}/LICENSE +0 -0
- {udata-10.4.1.dev35182.dist-info → udata-10.4.1.dev35201.dist-info}/WHEEL +0 -0
- {udata-10.4.1.dev35182.dist-info → udata-10.4.1.dev35201.dist-info}/entry_points.txt +0 -0
- {udata-10.4.1.dev35182.dist-info → udata-10.4.1.dev35201.dist-info}/top_level.txt +0 -0
udata/core/dataset/apiv2.py
CHANGED
|
@@ -191,7 +191,7 @@ dataset_fields = apiv2.model(
|
|
|
191
191
|
spatial_coverage_fields, allow_null=True, description="The spatial coverage"
|
|
192
192
|
),
|
|
193
193
|
"license": fields.Raw(
|
|
194
|
-
attribute=lambda d: marshal(d.license, license_fields)
|
|
194
|
+
attribute=lambda d: marshal(d.license or DEFAULT_LICENSE, license_fields)
|
|
195
195
|
if request.headers.get(FULL_OBJECTS_HEADER, False, bool)
|
|
196
196
|
else (d.license.id if d.license is not None else None),
|
|
197
197
|
default=DEFAULT_LICENSE["id"],
|
udata/core/followers/api.py
CHANGED
|
@@ -51,10 +51,14 @@ class FollowAPI(API):
|
|
|
51
51
|
def get(self, id):
|
|
52
52
|
"""List all followers for a given object"""
|
|
53
53
|
args = parser.parse_args()
|
|
54
|
-
model =
|
|
54
|
+
model = None
|
|
55
|
+
if hasattr(self.model, "slug"):
|
|
56
|
+
model = self.model.objects(slug=id).first()
|
|
57
|
+
model = model or self.model.objects.only("id").get_or_404(id=id_or_404(id))
|
|
55
58
|
qs = Follow.objects(following=model, until=None)
|
|
56
59
|
if args["user"]:
|
|
57
60
|
qs = qs.filter(follower=id_or_404(args["user"]))
|
|
61
|
+
|
|
58
62
|
return qs.paginate(args["page"], args["page_size"])
|
|
59
63
|
|
|
60
64
|
@api.secure
|
|
@@ -19,6 +19,8 @@ from udata.core.dataset.api_fields import (
|
|
|
19
19
|
resource_harvest_fields,
|
|
20
20
|
)
|
|
21
21
|
from udata.core.dataset.constants import (
|
|
22
|
+
DEFAULT_FREQUENCY,
|
|
23
|
+
DEFAULT_LICENSE,
|
|
22
24
|
FULL_OBJECTS_HEADER,
|
|
23
25
|
LEGACY_FREQUENCIES,
|
|
24
26
|
RESOURCE_TYPES,
|
|
@@ -512,6 +514,7 @@ class DatasetAPITest(APITestCase):
|
|
|
512
514
|
license = LicenseFactory(id="lov2", title="Licence Ouverte Version 2.0")
|
|
513
515
|
paca, bdr, arles = create_geozones_fixtures()
|
|
514
516
|
country = GeoLevelFactory(id="country", name="Pays", admin_level=10)
|
|
517
|
+
other = GeoLevelFactory(id="other", name="Autre")
|
|
515
518
|
|
|
516
519
|
dataset = DatasetFactory(
|
|
517
520
|
frequency="monthly",
|
|
@@ -542,6 +545,27 @@ class DatasetAPITest(APITestCase):
|
|
|
542
545
|
assert response.json["spatial"]["granularity"]["id"] == "country"
|
|
543
546
|
assert response.json["spatial"]["granularity"]["name"] == country.name
|
|
544
547
|
|
|
548
|
+
dataset_without_anything = DatasetFactory(
|
|
549
|
+
frequency=None,
|
|
550
|
+
license=None,
|
|
551
|
+
spatial=SpatialCoverageFactory(zones=[], granularity=None),
|
|
552
|
+
)
|
|
553
|
+
|
|
554
|
+
response = self.get(
|
|
555
|
+
url_for("apiv2.dataset", dataset=dataset_without_anything),
|
|
556
|
+
headers={
|
|
557
|
+
FULL_OBJECTS_HEADER: "True",
|
|
558
|
+
},
|
|
559
|
+
)
|
|
560
|
+
self.assert200(response)
|
|
561
|
+
assert response.json["frequency"]["id"] == DEFAULT_FREQUENCY
|
|
562
|
+
assert response.json["frequency"]["label"] == UPDATE_FREQUENCIES.get(DEFAULT_FREQUENCY)
|
|
563
|
+
assert response.json["license"]["id"] == DEFAULT_LICENSE["id"]
|
|
564
|
+
assert response.json["license"]["title"] == DEFAULT_LICENSE["title"]
|
|
565
|
+
assert len(response.json["spatial"]["zones"]) == 0
|
|
566
|
+
assert response.json["spatial"]["granularity"]["id"] == "other"
|
|
567
|
+
assert response.json["spatial"]["granularity"]["name"] == other.name
|
|
568
|
+
|
|
545
569
|
def test_dataset_api_create(self):
|
|
546
570
|
"""It should create a dataset from the API"""
|
|
547
571
|
data = DatasetFactory.as_dict()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: udata
|
|
3
|
-
Version: 10.4.1.
|
|
3
|
+
Version: 10.4.1.dev35201
|
|
4
4
|
Summary: Open data portal
|
|
5
5
|
Home-page: https://github.com/opendatateam/udata
|
|
6
6
|
Author: Opendata Team
|
|
@@ -141,6 +141,8 @@ It is collectively taken care of by members of the
|
|
|
141
141
|
|
|
142
142
|
## Current (in progress)
|
|
143
143
|
|
|
144
|
+
- Add missing default for license full object [#3317](https://github.com/opendatateam/udata/pull/3317/)
|
|
145
|
+
- Check for slugs in followers API [#3320](https://github.com/opendatateam/udata/pull/3320)
|
|
144
146
|
- Fix missing ID in dataset reuses mask [#3321](https://github.com/opendatateam/udata/pull/3321)
|
|
145
147
|
|
|
146
148
|
## 10.4.0 (2025-05-15)
|
|
@@ -96,7 +96,7 @@ udata/core/dataset/actions.py,sha256=mX6xox0PiMrbcAPZ3VZsI26rfM-ciYfEXxN6sqqImKA
|
|
|
96
96
|
udata/core/dataset/activities.py,sha256=v8k1jwhdx62Z2ARZq8Q-x86OWSsBK99hRloPl74OCgA,1502
|
|
97
97
|
udata/core/dataset/api.py,sha256=jElQZuguc514Eb0cWdquEfosP1yB79hEQ52SV_SvLx8,33282
|
|
98
98
|
udata/core/dataset/api_fields.py,sha256=SLuzWoPdMLPX28WQ9DRGUPKS27vlltiFeiTo6jXa55Q,17549
|
|
99
|
-
udata/core/dataset/apiv2.py,sha256=
|
|
99
|
+
udata/core/dataset/apiv2.py,sha256=YOCNqQh7_OODcrzqJqdAPc0CoB9vG0DVcFiJNl9yBwQ,20749
|
|
100
100
|
udata/core/dataset/commands.py,sha256=__hPAk_6iHtgMnEG51ux0vbNWJHxUjXhi1ukH4hF5jY,3714
|
|
101
101
|
udata/core/dataset/constants.py,sha256=fKn21GzRShZv6pzKy3TvEK1cevQ9H3dOFE-xTRuE0lA,2971
|
|
102
102
|
udata/core/dataset/csv.py,sha256=aNJOytbFbH8OCYr6hyaSaqFSa94Xb3dvBd3QGZHJRsA,3633
|
|
@@ -125,7 +125,7 @@ udata/core/discussions/permissions.py,sha256=VY2_PEsazz1fBgCX9-K-_spRgxUoNY4HuND
|
|
|
125
125
|
udata/core/discussions/signals.py,sha256=tJ83RJIsBAny08Q6IDwehE6lDDRf6ynIFCl0WqnayoU,543
|
|
126
126
|
udata/core/discussions/tasks.py,sha256=j78n9Pv04ftyt5KJHVZQwaxjgxDqyc9jbV49286A0wE,2761
|
|
127
127
|
udata/core/followers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
128
|
-
udata/core/followers/api.py,sha256=
|
|
128
|
+
udata/core/followers/api.py,sha256=oCkEl_NUuizkssowlUyzCNK5IUq8GjNLVz1HN4HVqlg,2904
|
|
129
129
|
udata/core/followers/metrics.py,sha256=nKgoiM2Gu-XHrgEf9duW1My66zFSKbmw25BGqo5wWtY,190
|
|
130
130
|
udata/core/followers/models.py,sha256=PvExrmKbdr0oFjoMYfg1ZUuFlPYGCKKwrE0_ouPaILs,1122
|
|
131
131
|
udata/core/followers/signals.py,sha256=q0su1eArVO1pnCoNFDieG-kW3iL-hLuXTmnU1-NXNF0,528
|
|
@@ -626,7 +626,7 @@ udata/tests/api/test_auth_api.py,sha256=OMRlY0OQt60j5N4A-N3HdWTuffOjRlFHkz5a3jJF
|
|
|
626
626
|
udata/tests/api/test_base_api.py,sha256=2w_vz0eEuq3P3aN-ByvxGc3VZAo7XtgatFfcrzf2uEU,2244
|
|
627
627
|
udata/tests/api/test_contact_points.py,sha256=X_RWD_xCfR8WchhHfKEt5mxMHY77OmTyguNKCsZftdE,5337
|
|
628
628
|
udata/tests/api/test_dataservices_api.py,sha256=fNpeHl4SMvci3QrC414X6KGorv7NS1y8LsGxcSMjjZY,25729
|
|
629
|
-
udata/tests/api/test_datasets_api.py,sha256=
|
|
629
|
+
udata/tests/api/test_datasets_api.py,sha256=Igu8NrOfDEtYKjlG7CrL_VpiFN2Tp6W-Kj4r8mpK1os,98789
|
|
630
630
|
udata/tests/api/test_fields.py,sha256=OW85Z5MES5HeWOpapeem8OvR1cIcrqW-xMWpdZO4LZ8,1033
|
|
631
631
|
udata/tests/api/test_follow_api.py,sha256=XP6I96JUNT6xjGcQOF7pug_T_i67HzCiOGLaPdpfpEQ,4912
|
|
632
632
|
udata/tests/api/test_me_api.py,sha256=YPd8zmR3zwJKtpSqz8nY1nOOMyXs66INeBwyhg5D0Us,13846
|
|
@@ -726,9 +726,9 @@ udata/translations/pt/LC_MESSAGES/udata.mo,sha256=ViV14tUmjSydHS0TWG_mFikKQfyUaT
|
|
|
726
726
|
udata/translations/pt/LC_MESSAGES/udata.po,sha256=rzAD_MVoV54TmN3w1ECz3H2Ru5pM7hWMVH03SkY28Q8,47250
|
|
727
727
|
udata/translations/sr/LC_MESSAGES/udata.mo,sha256=EHX1_D-Uglj38832G7BrA0QC5IuY3p8dKqi9T0DgPmE,29169
|
|
728
728
|
udata/translations/sr/LC_MESSAGES/udata.po,sha256=3PMnbVhKVJh6Q8ABi1ZTZ8Dcf-sMjngLJZqLbonJoec,54225
|
|
729
|
-
udata-10.4.1.
|
|
730
|
-
udata-10.4.1.
|
|
731
|
-
udata-10.4.1.
|
|
732
|
-
udata-10.4.1.
|
|
733
|
-
udata-10.4.1.
|
|
734
|
-
udata-10.4.1.
|
|
729
|
+
udata-10.4.1.dev35201.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
|
|
730
|
+
udata-10.4.1.dev35201.dist-info/METADATA,sha256=KyBd59eD9z2ifJGnDzxBDkz9hw0mY69JJXtL9XdgQf4,146345
|
|
731
|
+
udata-10.4.1.dev35201.dist-info/WHEEL,sha256=Kh9pAotZVRFj97E15yTA4iADqXdQfIVTHcNaZTjxeGM,110
|
|
732
|
+
udata-10.4.1.dev35201.dist-info/entry_points.txt,sha256=ETvkR4r6G1duBsh_V_fGWENQy17GTFuobi95MYBAl1A,498
|
|
733
|
+
udata-10.4.1.dev35201.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
|
|
734
|
+
udata-10.4.1.dev35201.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|