fix: Correct indentation errors in backend services
Some checks failed
CI / Frontend Lint & Type Check (push) Has been cancelled
CI / Frontend Build (push) Has been cancelled
CI / Backend Lint (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
Deploy / Build & Push Images (push) Has been cancelled
Deploy / Deploy to Server (push) Has been cancelled
Deploy / Notify (push) Has been cancelled

- Fix 2 indentation errors in domain_checker.py (lines 200, 205)
- Fix 2 indentation errors in domain_health.py (lines 412, 436, 447)
- Fix NameError in playwright_scraper.py when playwright not installed
- Add fallback type definitions for Browser, BrowserContext, Page
This commit is contained in:
2025-12-11 20:10:35 +01:00
parent 9acc40b658
commit 4276de7774
3 changed files with 11 additions and 7 deletions

View File

@ -197,12 +197,12 @@ class DomainChecker:
# Expiration date - check multiple variations # Expiration date - check multiple variations
if not expiration_date: if not expiration_date:
if any(x in action for x in ['expiration', 'expire']): if any(x in action for x in ['expiration', 'expire']):
expiration_date = self._parse_datetime(date_str) expiration_date = self._parse_datetime(date_str)
# Creation/registration date # Creation/registration date
if not creation_date: if not creation_date:
if any(x in action for x in ['registration', 'created']): if any(x in action for x in ['registration', 'created']):
creation_date = self._parse_datetime(date_str) creation_date = self._parse_datetime(date_str)
# Update date # Update date
if any(x in action for x in ['changed', 'update', 'last changed']): if any(x in action for x in ['changed', 'update', 'last changed']):

View File

@ -409,7 +409,7 @@ class DomainHealthChecker:
result.has_ssl = True result.has_ssl = True
result.is_valid = True # Certificate exists and is technically valid, just can't verify chain locally result.is_valid = True # Certificate exists and is technically valid, just can't verify chain locally
except Exception: except Exception:
result.has_ssl = True result.has_ssl = True
result.is_valid = False result.is_valid = False
result.error = "Certificate exists but could not be parsed" result.error = "Certificate exists but could not be parsed"
return result return result
@ -433,8 +433,8 @@ class DomainHealthChecker:
for item in issuer: for item in issuer:
if isinstance(item, tuple) and len(item) > 0: if isinstance(item, tuple) and len(item) > 0:
if isinstance(item[0], tuple) and item[0][0] == 'organizationName': if isinstance(item[0], tuple) and item[0][0] == 'organizationName':
result.issuer = item[0][1] result.issuer = item[0][1]
break break
elif isinstance(item[0], str) and item[0] == 'organizationName': elif isinstance(item[0], str) and item[0] == 'organizationName':
result.issuer = item[1] if len(item) > 1 else None result.issuer = item[1] if len(item) > 1 else None
break break
@ -444,8 +444,8 @@ class DomainHealthChecker:
result.has_ssl = False result.has_ssl = False
result.error = "Port 443 not responding" result.error = "Port 443 not responding"
else: else:
result.has_ssl = False result.has_ssl = False
result.error = "no_ssl" result.error = "no_ssl"
except Exception as e: except Exception as e:
result.error = str(e) result.error = str(e)

View File

@ -42,6 +42,10 @@ try:
except ImportError: except ImportError:
PLAYWRIGHT_AVAILABLE = False PLAYWRIGHT_AVAILABLE = False
Stealth = None Stealth = None
# Define dummy types for type hints
Browser = Any
BrowserContext = Any
Page = Any
logger.warning("Playwright not installed. Stealth scraping disabled.") logger.warning("Playwright not installed. Stealth scraping disabled.")