Skip to content

Commit

Permalink
Use inital function name for _check_url_link
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Apr 18, 2024
1 parent c26faa1 commit 07824ef
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions qgis-app/plugins/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ def _check_required_metadata(metadata):
)
)

def _check_urls(urls):
def _check_url_link(urls):
"""
Checks if all the url link is valid.
"""
def error_check(url: str, forbidden_url: str)->bool:
# Check against forbidden_url
if url == forbidden_url:
return True

# Check if parsed URL is valid
try:
parsed_url = urlparse(url)
Expand All @@ -131,7 +131,7 @@ def error_check_if_exist(url: str)->bool:
except Exception:
return True
return req.status_code >= 400

url_error = [item for item in [url_item['metadata_attr'] for url_item in urls if error_check(url_item['url'], url_item['forbidden_url'])]]
if len(url_error) > 0:
url_error_str = ", ".join(url_error)
Expand Down Expand Up @@ -339,7 +339,7 @@ def validator(package):
{'url': dict(metadata).get("homepage"), 'forbidden_url': "http://homepage", 'metadata_attr': "homepage"},
]

_check_urls(urls_to_check)
_check_url_link(urls_to_check)


# Checks for LICENCE file presence
Expand Down

0 comments on commit 07824ef

Please sign in to comment.