fixing DQ issues
This commit is contained in:
@@ -22,12 +22,14 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class MarketplaceService:
|
||||
"""Service class for Marketplace operations following the application's service pattern."""
|
||||
|
||||
def __init__(self):
|
||||
"""Class constructor."""
|
||||
pass
|
||||
|
||||
def validate_shop_access(self, db: Session, shop_code: str, user: User) -> Shop:
|
||||
"""Validate that the shop exists and user has access to it"""
|
||||
"""Validate that the shop exists and user has access to it."""
|
||||
# Explicit type hint to help type checker shop: Optional[Shop]
|
||||
# Use case-insensitive query to handle both uppercase and lowercase codes
|
||||
shop: Optional[Shop] = (
|
||||
@@ -67,7 +69,8 @@ class MarketplaceService:
|
||||
db.refresh(import_job)
|
||||
|
||||
logger.info(
|
||||
f"Created marketplace import job {import_job.id}: {request.marketplace} -> {shop.shop_name} (shop_code: {shop.shop_code}) by user {user.username}"
|
||||
f"Created marketplace import job {import_job.id}: "
|
||||
f"{request.marketplace} -> {shop.shop_name} (shop_code: {shop.shop_code}) by user {user.username}"
|
||||
)
|
||||
|
||||
return import_job
|
||||
|
||||
Reference in New Issue
Block a user