test updates to take into account exception management
This commit is contained in:
@@ -337,27 +337,6 @@ class AdminService:
|
||||
completed_at=job.completed_at,
|
||||
)
|
||||
|
||||
# Legacy methods for backward compatibility (mark as deprecated)
|
||||
def get_user_by_id(self, db: Session, user_id: int) -> Optional[User]:
|
||||
"""Get user by ID. DEPRECATED: Use _get_user_by_id_or_raise instead."""
|
||||
logger.warning("get_user_by_id is deprecated, use proper exception handling")
|
||||
return db.query(User).filter(User.id == user_id).first()
|
||||
|
||||
def get_shop_by_id(self, db: Session, shop_id: int) -> Optional[Shop]:
|
||||
"""Get shop by ID. DEPRECATED: Use _get_shop_by_id_or_raise instead."""
|
||||
logger.warning("get_shop_by_id is deprecated, use proper exception handling")
|
||||
return db.query(Shop).filter(Shop.id == shop_id).first()
|
||||
|
||||
def user_exists(self, db: Session, user_id: int) -> bool:
|
||||
"""Check if user exists by ID. DEPRECATED: Use proper exception handling."""
|
||||
logger.warning("user_exists is deprecated, use proper exception handling")
|
||||
return db.query(User).filter(User.id == user_id).first() is not None
|
||||
|
||||
def shop_exists(self, db: Session, shop_id: int) -> bool:
|
||||
"""Check if shop exists by ID. DEPRECATED: Use proper exception handling."""
|
||||
logger.warning("shop_exists is deprecated, use proper exception handling")
|
||||
return db.query(Shop).filter(Shop.id == shop_id).first() is not None
|
||||
|
||||
|
||||
# Create service instance following the same pattern as product_service
|
||||
admin_service = AdminService()
|
||||
|
||||
Reference in New Issue
Block a user