ready for prod
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 2m25s
Run linting on the backend code / Build (pull_request) Successful in 27s
Run testing on the backend code / Build (pull_request) Failing after 4m5s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 24s

This commit is contained in:
Helldragon67 2025-01-23 12:37:47 +01:00
parent 150055c1b2
commit b30fa1f02e
2 changed files with 14 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@ -40,7 +40,7 @@ class ToiletsManager:
self.radius = radius
self.location = location
CachingStrategy.use('XML', cacheDir=OSM_CACHE_DIR)
CachingStrategy.use('XML', cache_dir=OSM_CACHE_DIR)
def generate_toilet_list(self) -> list[Toilets] :
@ -52,14 +52,14 @@ class ToiletsManager:
list[Toilets]: A list of `Toilets` objects containing detailed information
about the toilets found around the given coordinates.
"""
bbox = tuple((f"around:{self.radius}", str(self.location[0]), str(self.location[1])))
bbox = tuple((self.radius, self.location[0], self.location[1]))
osm_types = ['node', 'way', 'relation']
toilets_list = []
query = build_query(
area = bbox,
element_types = osm_types,
selector = ['"amenity"="toilets"'],
selector = '"amenity"="toilets"',
out = 'ids center tags'
)
self.logger.debug(f"Query: {query}")
@ -118,17 +118,17 @@ class ToiletsManager:
# Extract tags as a dictionary
tags = {tag.get('k'): tag.get('v') for tag in elem.findall('tag')}
if 'wheelchair' in tags().keys() and tags['wheelchair'] == 'yes':
if 'wheelchair' in tags.keys() and tags['wheelchair'] == 'yes':
toilets.wheelchair = True
if 'changing_table' in tags().keys() and tags['changing_table'] == 'yes':
if 'changing_table' in tags.keys() and tags['changing_table'] == 'yes':
toilets.changing_table = True
if 'fee' in tags().keys() and tags['fee'] == 'yes':
if 'fee' in tags.keys() and tags['fee'] == 'yes':
toilets.fee = True
if 'opening_hours' in tags().keys() :
toilets.opening_hours = elem.tag('opening_hours')
if 'opening_hours' in tags.keys() :
toilets.opening_hours = tags['opening_hours']
toilets_list.append(toilets)