Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
EvilDrPurple committed Nov 22, 2024
1 parent 1b6ee2e commit 560637f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source_collectors/ckan/ckan_identifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,14 @@ def is_ckan_hosted(response: Response) -> bool:
:param response: The response object.
:return: True if the CKAN version tag is found, False otherwise.
"""
if not response.ok:
return False

soup = BeautifulSoup(response.content, "lxml")

if soup.head is None:
return False

# Checks if the CKAN version tag is present, looks like this:
# <meta name="generator" content="ckan 2.10.5">
ckan_tag = soup.head.find(content=re.compile("ckan \d+\.\d+\.\d+"))

Check warning on line 48 in source_collectors/ckan/ckan_identifier.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] source_collectors/ckan/ckan_identifier.py#L48 <605>

invalid escape sequence '\d'
Raw output
./source_collectors/ckan/ckan_identifier.py:48:56: W605 invalid escape sequence '\d'

Check warning on line 48 in source_collectors/ckan/ckan_identifier.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] source_collectors/ckan/ckan_identifier.py#L48 <605>

invalid escape sequence '\.'
Raw output
./source_collectors/ckan/ckan_identifier.py:48:59: W605 invalid escape sequence '\.'

Check warning on line 48 in source_collectors/ckan/ckan_identifier.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] source_collectors/ckan/ckan_identifier.py#L48 <605>

invalid escape sequence '\d'
Raw output
./source_collectors/ckan/ckan_identifier.py:48:61: W605 invalid escape sequence '\d'

Check warning on line 48 in source_collectors/ckan/ckan_identifier.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] source_collectors/ckan/ckan_identifier.py#L48 <605>

invalid escape sequence '\.'
Raw output
./source_collectors/ckan/ckan_identifier.py:48:64: W605 invalid escape sequence '\.'

Check warning on line 48 in source_collectors/ckan/ckan_identifier.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] source_collectors/ckan/ckan_identifier.py#L48 <605>

invalid escape sequence '\d'
Raw output
./source_collectors/ckan/ckan_identifier.py:48:66: W605 invalid escape sequence '\d'
Expand Down

0 comments on commit 560637f

Please sign in to comment.