udata 9.1.1__py2.py3-none-any.whl → 9.1.1.dev30065__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/__init__.py +1 -1
- udata/harvest/api.py +1 -5
- udata/harvest/tests/test_api.py +3 -33
- {udata-9.1.1.dist-info → udata-9.1.1.dev30065.dist-info}/METADATA +3 -3
- {udata-9.1.1.dist-info → udata-9.1.1.dev30065.dist-info}/RECORD +9 -9
- {udata-9.1.1.dist-info → udata-9.1.1.dev30065.dist-info}/LICENSE +0 -0
- {udata-9.1.1.dist-info → udata-9.1.1.dev30065.dist-info}/WHEEL +0 -0
- {udata-9.1.1.dist-info → udata-9.1.1.dev30065.dist-info}/entry_points.txt +0 -0
- {udata-9.1.1.dist-info → udata-9.1.1.dev30065.dist-info}/top_level.txt +0 -0
udata/__init__.py
CHANGED
udata/harvest/api.py
CHANGED
|
@@ -8,14 +8,13 @@ from udata.auth import admin_permission
|
|
|
8
8
|
from udata.core.dataservices.models import Dataservice
|
|
9
9
|
from udata.core.dataset.api_fields import dataset_ref_fields, dataset_fields
|
|
10
10
|
from udata.core.organization.api_fields import org_ref_fields
|
|
11
|
-
from udata.core.dataset.permissions import OwnablePermission
|
|
12
11
|
from udata.core.organization.permissions import EditOrganizationPermission
|
|
13
12
|
from udata.core.user.api_fields import user_ref_fields
|
|
14
13
|
|
|
15
14
|
from . import actions
|
|
16
15
|
from .forms import HarvestSourceForm, HarvestSourceValidationForm
|
|
17
16
|
from .models import (
|
|
18
|
-
HARVEST_JOB_STATUS, HARVEST_ITEM_STATUS, HarvestJob,
|
|
17
|
+
HARVEST_JOB_STATUS, HARVEST_ITEM_STATUS, HarvestJob,
|
|
19
18
|
VALIDATION_STATES, VALIDATION_ACCEPTED
|
|
20
19
|
)
|
|
21
20
|
|
|
@@ -234,7 +233,6 @@ class SourceAPI(API):
|
|
|
234
233
|
def put(self, ident):
|
|
235
234
|
'''Update a harvest source'''
|
|
236
235
|
source = actions.get_source(ident)
|
|
237
|
-
OwnablePermission(source).test()
|
|
238
236
|
form = api.validate(HarvestSourceForm, source)
|
|
239
237
|
source = actions.update_source(ident, form.data)
|
|
240
238
|
return source
|
|
@@ -243,8 +241,6 @@ class SourceAPI(API):
|
|
|
243
241
|
@api.doc('delete_harvest_source')
|
|
244
242
|
@api.marshal_with(source_fields)
|
|
245
243
|
def delete(self, ident):
|
|
246
|
-
source: HarvestSource = actions.get_source(ident)
|
|
247
|
-
OwnablePermission(source).test()
|
|
248
244
|
return actions.delete_source(ident), 204
|
|
249
245
|
|
|
250
246
|
|
udata/harvest/tests/test_api.py
CHANGED
|
@@ -295,7 +295,7 @@ class HarvestAPITest(MockBackendsMixin):
|
|
|
295
295
|
assert source['config'] == {'custom': 'value'}
|
|
296
296
|
|
|
297
297
|
def test_update_source(self, api):
|
|
298
|
-
'''It should update a source
|
|
298
|
+
'''It should update a source'''
|
|
299
299
|
user = api.login()
|
|
300
300
|
source = HarvestSourceFactory(owner=user)
|
|
301
301
|
new_url = faker.url()
|
|
@@ -307,31 +307,11 @@ class HarvestAPITest(MockBackendsMixin):
|
|
|
307
307
|
}
|
|
308
308
|
api_url = url_for('api.harvest_source', ident=str(source.id))
|
|
309
309
|
response = api.put(api_url, data)
|
|
310
|
-
assert200(response)
|
|
311
|
-
assert response.json['url'] == new_url
|
|
312
310
|
|
|
313
|
-
# Source is now owned by orga, with user as member
|
|
314
|
-
source.organization = OrganizationFactory(members=[Member(user=user)])
|
|
315
|
-
source.save()
|
|
316
|
-
api_url = url_for('api.harvest_source', ident=str(source.id))
|
|
317
|
-
response = api.put(api_url, data)
|
|
318
311
|
assert200(response)
|
|
319
312
|
|
|
320
|
-
|
|
321
|
-
''
|
|
322
|
-
api.login()
|
|
323
|
-
source = HarvestSourceFactory()
|
|
324
|
-
new_url: str = faker.url()
|
|
325
|
-
data = {
|
|
326
|
-
'name': source.name,
|
|
327
|
-
'description': source.description,
|
|
328
|
-
'url': new_url,
|
|
329
|
-
'backend': 'factory',
|
|
330
|
-
}
|
|
331
|
-
api_url: str = url_for('api.harvest_source', ident=str(source.id))
|
|
332
|
-
response = api.put(api_url, data)
|
|
333
|
-
|
|
334
|
-
assert403(response)
|
|
313
|
+
source = response.json
|
|
314
|
+
assert source['url'] == new_url
|
|
335
315
|
|
|
336
316
|
def test_validate_source(self, api):
|
|
337
317
|
'''It should allow to validate a source if admin'''
|
|
@@ -408,16 +388,6 @@ class HarvestAPITest(MockBackendsMixin):
|
|
|
408
388
|
deleted_sources = HarvestSource.objects(deleted__exists=True)
|
|
409
389
|
assert len(deleted_sources) == 1
|
|
410
390
|
|
|
411
|
-
def test_delete_source_require_permission(self, api):
|
|
412
|
-
'''It should not delete a source if not the owner'''
|
|
413
|
-
api.login()
|
|
414
|
-
source = HarvestSourceFactory()
|
|
415
|
-
|
|
416
|
-
url = url_for('api.harvest_source', ident=str(source.id))
|
|
417
|
-
response = api.delete(url)
|
|
418
|
-
|
|
419
|
-
assert403(response)
|
|
420
|
-
|
|
421
391
|
def test_schedule_source(self, api):
|
|
422
392
|
'''It should allow to schedule a source if admin'''
|
|
423
393
|
api.login(AdminFactory())
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: udata
|
|
3
|
-
Version: 9.1.1
|
|
3
|
+
Version: 9.1.1.dev30065
|
|
4
4
|
Summary: Open data portal
|
|
5
5
|
Home-page: https://github.com/opendatateam/udata
|
|
6
6
|
Author: Opendata Team
|
|
@@ -135,9 +135,9 @@ It is collectively taken care of by members of the
|
|
|
135
135
|
|
|
136
136
|
# Changelog
|
|
137
137
|
|
|
138
|
-
##
|
|
138
|
+
## Current (in progress)
|
|
139
139
|
|
|
140
|
-
-
|
|
140
|
+
- Nothing yet
|
|
141
141
|
|
|
142
142
|
## 9.1.0 (2024-07-11)
|
|
143
143
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
tasks/__init__.py,sha256=CnVhb_TV-6nMhxVR6itnBmvuU2OSCs02AfNB4irVBTE,8132
|
|
2
2
|
tasks/helpers.py,sha256=k_HiuiEJNgQLvWdeHqczPOAcrYpFjEepBeKo7EQzY8M,994
|
|
3
|
-
udata/__init__.py,sha256=
|
|
3
|
+
udata/__init__.py,sha256=a_0C0r_2R95IDuQIPxy824R2gZgKQ_n8DFcOhdmcNZ8,101
|
|
4
4
|
udata/api_fields.py,sha256=zx-BPYajUyRKOOIFIebn-MFSrRIyi4O-sf97V7KjoOI,13461
|
|
5
5
|
udata/app.py,sha256=6upwrImLaWrSYtsXPW1zH84_oRxp3B6XFuocMe2D6NU,7329
|
|
6
6
|
udata/assets.py,sha256=aMa-MnAEXVSTavptSn2V8sUE6jL_N0MrYCQ6_QpsuHs,645
|
|
@@ -276,7 +276,7 @@ udata/frontend/csv.py,sha256=SDV8GMhNpHyE9NYy9cfHulsFUzwclfc7roWAAm-PZ9M,8257
|
|
|
276
276
|
udata/frontend/markdown.py,sha256=41bOiU6AKng4U-5v3otBed3dyCu63NI9fnznUQThbIk,4377
|
|
277
277
|
udata/harvest/__init__.py,sha256=C4y5w4vGb_F9Opy62lzV3eHo4DkNyRgPCq-wsarPXiQ,28
|
|
278
278
|
udata/harvest/actions.py,sha256=6f9bkIITLHes0vGU-yioRGfFOghAS3nXThXEVKaHFpA,10082
|
|
279
|
-
udata/harvest/api.py,sha256=
|
|
279
|
+
udata/harvest/api.py,sha256=sG84NsGURzXP108lCI0Bq876Gf0qbXPsrDUf2eLGnUE,14774
|
|
280
280
|
udata/harvest/commands.py,sha256=Vo1KxO7GAOgQ87khqlGIyjZIlwAOlQ8ztadqmWdMvwk,4922
|
|
281
281
|
udata/harvest/csv.py,sha256=c2fPnMB6q99wRxLncl8L0ILcdF4SI8Lsl8tViNrcW6A,396
|
|
282
282
|
udata/harvest/exceptions.py,sha256=YaXw0ESmSCcibfUmP5uc1uRedKD2mvUBXUOnbaSXtNw,299
|
|
@@ -292,7 +292,7 @@ udata/harvest/backends/dcat.py,sha256=-VvV3eHuiEMUbms15VdKO4ONQiqtoLLFR0425km9C_
|
|
|
292
292
|
udata/harvest/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
293
293
|
udata/harvest/tests/factories.py,sha256=vUFON9GzI5CbD3bP8_ayOs3S9pHbhhHiI7B4GhoQtVE,2218
|
|
294
294
|
udata/harvest/tests/test_actions.py,sha256=TPHb8n8tlQ0l2lu8GzbymKPOpzTeN_VCtFmszZoCAQI,27583
|
|
295
|
-
udata/harvest/tests/test_api.py,sha256=
|
|
295
|
+
udata/harvest/tests/test_api.py,sha256=QXhseHfnkBEmMbIJzroMdDYGLDj6Njal1s-2sn0xhEM,14888
|
|
296
296
|
udata/harvest/tests/test_base_backend.py,sha256=idFssHnN1iv2ktP1b1IlDpGglVR4Rzza-XuJr68KIlA,12240
|
|
297
297
|
udata/harvest/tests/test_dcat_backend.py,sha256=bOb6hmgoGB4usjFA6s9fzLKAMGOKmWXFpF0DEPeJBVQ,34118
|
|
298
298
|
udata/harvest/tests/test_filters.py,sha256=V2HFZlexIJa6r1DX6g2ktvIgjg4gSY11QPfPOd3_Oug,2370
|
|
@@ -696,9 +696,9 @@ udata/translations/pt/LC_MESSAGES/udata.mo,sha256=yfwqLHV-_mGNaDklP7T0pQP4i1y__s
|
|
|
696
696
|
udata/translations/pt/LC_MESSAGES/udata.po,sha256=E45ZRCW2bpedoWOztkgJ9gwBlg2L1pTcHmCXgqSdhT0,44979
|
|
697
697
|
udata/translations/sr/LC_MESSAGES/udata.mo,sha256=w_x0mh_WagUuQ5QFweqHg5-HtDrsoyL66HVmUxrdR0U,28500
|
|
698
698
|
udata/translations/sr/LC_MESSAGES/udata.po,sha256=LfaUQzhrfDClLdBo_U2erasp2XR1z1_V132cewvZ9C8,51548
|
|
699
|
-
udata-9.1.1.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
|
|
700
|
-
udata-9.1.1.dist-info/METADATA,sha256=
|
|
701
|
-
udata-9.1.1.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
|
702
|
-
udata-9.1.1.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
|
|
703
|
-
udata-9.1.1.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
|
|
704
|
-
udata-9.1.1.dist-info/RECORD,,
|
|
699
|
+
udata-9.1.1.dev30065.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
|
|
700
|
+
udata-9.1.1.dev30065.dist-info/METADATA,sha256=loM9w0Wh9pSLT0mlBqvuci1BTwON8rTMvxPegnpX4QE,125744
|
|
701
|
+
udata-9.1.1.dev30065.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
|
|
702
|
+
udata-9.1.1.dev30065.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
|
|
703
|
+
udata-9.1.1.dev30065.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
|
|
704
|
+
udata-9.1.1.dev30065.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|