@@ -57,8 +57,7 @@ def __init__(
57
57
** kwargs
58
58
) -> None :
59
59
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 ("/" )
62
61
self ._api_client = PostgRestClient (self .base_api_url , page_size = page_size )
63
62
self .harvest_alerts = harvest_alerts
64
63
self .harvest_documents = harvest_documents
@@ -286,7 +285,6 @@ def update_geonode_resource(
286
285
self ,
287
286
harvested_info : base .HarvestedResourceInfo ,
288
287
harvestable_resource : harvesting_models .HarvestableResource ,
289
- harvesting_session_id : int ,
290
288
):
291
289
handler = {
292
290
PdnResourceType .ALERT : self ._update_alert_record ,
@@ -296,7 +294,7 @@ def update_geonode_resource(
296
294
PdnResourceType .PROJECT : self ._update_project_record ,
297
295
}.get (PdnResourceType (harvestable_resource .remote_resource_type ))
298
296
if handler is not None :
299
- return handler (harvested_info , harvestable_resource , harvesting_session_id )
297
+ handler (harvested_info , harvestable_resource )
300
298
else :
301
299
raise RuntimeError (f"Invalid resource type: { harvestable_resource .remote_resource_type } " )
302
300
@@ -338,7 +336,6 @@ def _update_alert_record(
338
336
self ,
339
337
harvested_info : base .HarvestedResourceInfo ,
340
338
harvestable_resource : harvesting_models .HarvestableResource ,
341
- harvesting_session_id : int
342
339
) -> None :
343
340
raw_record : typing .Dict = harvested_info .additional_information
344
341
try :
@@ -362,7 +359,6 @@ def _update_expert_record(
362
359
self ,
363
360
harvested_info : base .HarvestedResourceInfo ,
364
361
harvestable_resource : harvesting_models .HarvestableResource ,
365
- harvesting_session_id : int
366
362
) -> None :
367
363
raw_record : typing .Dict = harvested_info .additional_information
368
364
models .Expert .objects .update_or_create (
@@ -382,7 +378,6 @@ def _update_news_record(
382
378
self ,
383
379
harvested_info : base .HarvestedResourceInfo ,
384
380
harvestable_resource : harvesting_models .HarvestableResource ,
385
- harvesting_session_id : int
386
381
) -> None :
387
382
raw_record : typing .Dict = harvested_info .additional_information
388
383
try :
@@ -406,7 +401,6 @@ def _update_project_record(
406
401
self ,
407
402
harvested_info : base .HarvestedResourceInfo ,
408
403
harvestable_resource : harvesting_models .HarvestableResource ,
409
- harvesting_session_id : int
410
404
) -> None :
411
405
raw_record : typing .Dict = harvested_info .additional_information
412
406
models .Project .objects .update_or_create (
0 commit comments