Skip to content

Commit

Permalink
Some modifications on remarks
Browse files Browse the repository at this point in the history
  • Loading branch information
kadhikari committed Sep 18, 2023
1 parent 415c7ee commit c15d3e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def __init__(

self._feed_publisher = FeedPublisher(**feed_publisher) if feed_publisher else None
if not isinstance(organizations, list):
self.organizations = organizations.strip('[').strip(']').split(',')
import json
self.organizations = json.loads(str(organizations))
else:
self.organizations = organizations

Expand Down Expand Up @@ -140,9 +141,6 @@ def _get_informations(self, poi):

if not obj_stations:
return Stands(0, 0, StandsStatus.unavailable)
vehicle_count = 0
for v in obj_stations[0].get('vehicles'):
vehicle_count = vehicle_count + v.get('count', 0)

stand = Stands(obj_stations[0].get('docks', {}).get('available', 0), vehicle_count, StandsStatus.open)
return stand
vehicle_count = sum((v.get('count', 0) for v in obj_stations[0].get('vehicles', {})))
return Stands(obj_stations[0].get('docks', {}).get('available', 0), vehicle_count, StandsStatus.open)
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def wrapper(*args, **kwargs):
car_park_provider_manager,
self.attribute,
self.logger,
'Error while handling global car park realtime availability',
f'Error while handling global car park realtime availability with configuration for instance: {instance}',
)

return response, status, h
Expand Down

0 comments on commit c15d3e9

Please sign in to comment.