Skip to content

Commit 16bbf44

Browse files
author
Ricardo Garcia Silva
committed
Updating the PDN harvester in order to work with recent changes to upstream GeoNode
1 parent 4a67fc5 commit 16bbf44

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/pdn/harvesters.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ def __init__(
5757
**kwargs
5858
) -> None:
5959
super().__init__(*args, **kwargs)
60-
if self.remote_url.endswith("/"):
61-
self.remote_url = self.remote_url[:-1]
60+
self.remote_url = self.remote_url.rstrip("/")
6261
self._api_client = PostgRestClient(self.base_api_url, page_size=page_size)
6362
self.harvest_alerts = harvest_alerts
6463
self.harvest_documents = harvest_documents
@@ -286,7 +285,6 @@ def update_geonode_resource(
286285
self,
287286
harvested_info: base.HarvestedResourceInfo,
288287
harvestable_resource: harvesting_models.HarvestableResource,
289-
harvesting_session_id: int,
290288
):
291289
handler = {
292290
PdnResourceType.ALERT: self._update_alert_record,
@@ -296,7 +294,7 @@ def update_geonode_resource(
296294
PdnResourceType.PROJECT: self._update_project_record,
297295
}.get(PdnResourceType(harvestable_resource.remote_resource_type))
298296
if handler is not None:
299-
return handler(harvested_info, harvestable_resource, harvesting_session_id)
297+
handler(harvested_info, harvestable_resource)
300298
else:
301299
raise RuntimeError(f"Invalid resource type: {harvestable_resource.remote_resource_type}")
302300

@@ -338,7 +336,6 @@ def _update_alert_record(
338336
self,
339337
harvested_info: base.HarvestedResourceInfo,
340338
harvestable_resource: harvesting_models.HarvestableResource,
341-
harvesting_session_id: int
342339
) -> None:
343340
raw_record: typing.Dict = harvested_info.additional_information
344341
try:
@@ -362,7 +359,6 @@ def _update_expert_record(
362359
self,
363360
harvested_info: base.HarvestedResourceInfo,
364361
harvestable_resource: harvesting_models.HarvestableResource,
365-
harvesting_session_id: int
366362
) -> None:
367363
raw_record: typing.Dict = harvested_info.additional_information
368364
models.Expert.objects.update_or_create(
@@ -382,7 +378,6 @@ def _update_news_record(
382378
self,
383379
harvested_info: base.HarvestedResourceInfo,
384380
harvestable_resource: harvesting_models.HarvestableResource,
385-
harvesting_session_id: int
386381
) -> None:
387382
raw_record: typing.Dict = harvested_info.additional_information
388383
try:
@@ -406,7 +401,6 @@ def _update_project_record(
406401
self,
407402
harvested_info: base.HarvestedResourceInfo,
408403
harvestable_resource: harvesting_models.HarvestableResource,
409-
harvesting_session_id: int
410404
) -> None:
411405
raw_record: typing.Dict = harvested_info.additional_information
412406
models.Project.objects.update_or_create(

0 commit comments

Comments
 (0)