fix: Correct indentation in TLD aggregator
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
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 indentation in _ensure_tld_info method - Fix nested if blocks for TLD type handling
This commit is contained in:
@ -166,7 +166,7 @@ class TLDPriceAggregator:
|
|||||||
|
|
||||||
# Also update/create TLDInfo if it doesn't exist (only once per TLD)
|
# Also update/create TLDInfo if it doesn't exist (only once per TLD)
|
||||||
if price_data.tld not in ensured_tlds:
|
if price_data.tld not in ensured_tlds:
|
||||||
await self._ensure_tld_info(db, price_data.tld)
|
await self._ensure_tld_info(db, price_data.tld)
|
||||||
ensured_tlds.add(price_data.tld)
|
ensured_tlds.add(price_data.tld)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@ -179,19 +179,19 @@ class TLDPriceAggregator:
|
|||||||
async def _ensure_tld_info(self, db: AsyncSession, tld: str):
|
async def _ensure_tld_info(self, db: AsyncSession, tld: str):
|
||||||
"""Ensure TLDInfo record exists for this TLD."""
|
"""Ensure TLDInfo record exists for this TLD."""
|
||||||
try:
|
try:
|
||||||
result = await db.execute(
|
result = await db.execute(
|
||||||
select(TLDInfo).where(TLDInfo.tld == tld)
|
select(TLDInfo).where(TLDInfo.tld == tld)
|
||||||
)
|
|
||||||
existing = result.scalar_one_or_none()
|
|
||||||
|
|
||||||
if not existing:
|
|
||||||
# Create basic TLDInfo record
|
|
||||||
tld_type = self._guess_tld_type(tld)
|
|
||||||
info = TLDInfo(
|
|
||||||
tld=tld,
|
|
||||||
type=tld_type,
|
|
||||||
)
|
)
|
||||||
db.add(info)
|
existing = result.scalar_one_or_none()
|
||||||
|
|
||||||
|
if not existing:
|
||||||
|
# Create basic TLDInfo record
|
||||||
|
tld_type = self._guess_tld_type(tld)
|
||||||
|
info = TLDInfo(
|
||||||
|
tld=tld,
|
||||||
|
type=tld_type,
|
||||||
|
)
|
||||||
|
db.add(info)
|
||||||
await db.flush() # Flush immediately to catch duplicates
|
await db.flush() # Flush immediately to catch duplicates
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# Ignore duplicate key errors - TLD already exists
|
# Ignore duplicate key errors - TLD already exists
|
||||||
|
|||||||
Reference in New Issue
Block a user