udata 9.1.1__py2.py3-none-any.whl → 9.1.1.dev30049__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 CHANGED
@@ -4,5 +4,5 @@
4
4
  udata
5
5
  '''
6
6
 
7
- __version__ = '9.1.1'
7
+ __version__ = '9.1.1.dev'
8
8
  __description__ = 'Open data portal'
@@ -41,7 +41,7 @@ reuse_fields = api.model('Reuse', {
41
41
  'last_modified': fields.ISODateTime(
42
42
  description='The reuse last modification date', readonly=True),
43
43
  'deleted': fields.ISODateTime(
44
- description='The deletion date if deleted', readonly=True),
44
+ description='The organization identifier', readonly=True),
45
45
  'datasets': fields.List(
46
46
  fields.Nested(dataset_fields), description='The reused datasets'),
47
47
  'organization': fields.Nested(
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, HarvestSource,
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
 
@@ -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 if owner or orga member'''
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
- def test_update_source_require_permission(self, api):
321
- '''It should not update a source if not the owner'''
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.dev30049
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
- ## 9.1.1 (2024-07-16)
138
+ ## Current (in progress)
139
139
 
140
- - Add correct owner permissions on harvest sources [#3091](https://github.com/opendatateam/udata/pull/3091)
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=00Am56rwXmIVejvRPsNTl7Hn1mnVFxT1iYo6ZAt75XM,97
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
@@ -168,7 +168,7 @@ udata/core/reports/models.py,sha256=eIQOKHJHaE5GeFguLsRJMUbHzdK77FXPpcsEBFcBYNg,
168
168
  udata/core/reuse/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
169
169
  udata/core/reuse/activities.py,sha256=rdl_CR3RJPBMonsHYmPnPVDvCYozNdXN2H1ILrTItNQ,1417
170
170
  udata/core/reuse/api.py,sha256=72oJxmwziqvuFhxcuXy-5ckhQo39t65hp4eqvSqbQ6o,10237
171
- udata/core/reuse/api_fields.py,sha256=WXzhHBQnGLI1AMWGKKkFkCscJZNDyc99vXbW63EYJFo,4872
171
+ udata/core/reuse/api_fields.py,sha256=aU5L7-jzywSZlO4cq2DfvvYmfmGMWcBimp959AVV3Zg,4871
172
172
  udata/core/reuse/apiv2.py,sha256=Op4f6pSMdUuLcCwNadojJfHfU6UYohrzSxlJbRn3wHc,824
173
173
  udata/core/reuse/constants.py,sha256=pbCR1xX9v4tdewlOx8bgNmy1-5V9OXIbpNjJivnQ--A,1215
174
174
  udata/core/reuse/csv.py,sha256=bOKS3LYGmQHj-qPkvxZVnbIju_sYDYjehGCM3Bj75lM,843
@@ -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=xAUzJL6fbj_XZnjo-9MPxlaiQ39AuDkGKIggbkF731c,14990
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=JmtgsTD4GeDmwLfXNy2oYn-4_JzG-v6yMXcBDZ6iKXQ,16028
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=Va5grYrIVFZYj_XL7isxDfq-Tw_MxT6GX-mzxclR9P4,125826
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.dev30049.dist-info/LICENSE,sha256=V8j_M8nAz8PvAOZQocyRDX7keai8UJ9skgmnwqETmdY,34520
700
+ udata-9.1.1.dev30049.dist-info/METADATA,sha256=fFu1IuORdQ9InWA47zoPvPOTO5_wu2vcTbU1D6Sp3i4,125744
701
+ udata-9.1.1.dev30049.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
702
+ udata-9.1.1.dev30049.dist-info/entry_points.txt,sha256=3SKiqVy4HUqxf6iWspgMqH8d88Htk6KoLbG1BU-UddQ,451
703
+ udata-9.1.1.dev30049.dist-info/top_level.txt,sha256=39OCg-VWFWOq4gCKnjKNu-s3OwFlZIu_dVH8Gl6ndHw,12
704
+ udata-9.1.1.dev30049.dist-info/RECORD,,