style: apply black and isort formatting across entire codebase

- Standardize quote style (single to double quotes)
- Reorder and group imports alphabetically
- Fix line breaks and indentation for consistency
- Apply PEP 8 formatting standards

Also updated Makefile to exclude both venv and .venv from code quality checks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-28 19:30:17 +01:00
parent 13f0094743
commit 21c13ca39b
236 changed files with 8450 additions and 6545 deletions

View File

@@ -4,12 +4,9 @@ Admin operations specific exceptions.
"""
from typing import Any, Dict, Optional
from .base import (
ResourceNotFoundException,
BusinessLogicException,
AuthorizationException,
ValidationException
)
from .base import (AuthorizationException, BusinessLogicException,
ResourceNotFoundException, ValidationException)
class UserNotFoundException(ResourceNotFoundException):
@@ -35,11 +32,11 @@ class UserStatusChangeException(BusinessLogicException):
"""Raised when user status cannot be changed."""
def __init__(
self,
user_id: int,
current_status: str,
attempted_action: str,
reason: Optional[str] = None,
self,
user_id: int,
current_status: str,
attempted_action: str,
reason: Optional[str] = None,
):
message = f"Cannot {attempted_action} user {user_id} (current status: {current_status})"
if reason:
@@ -61,10 +58,10 @@ class ShopVerificationException(BusinessLogicException):
"""Raised when shop verification fails."""
def __init__(
self,
shop_id: int,
reason: str,
current_verification_status: Optional[bool] = None,
self,
shop_id: int,
reason: str,
current_verification_status: Optional[bool] = None,
):
details = {
"shop_id": shop_id,
@@ -85,11 +82,11 @@ class AdminOperationException(BusinessLogicException):
"""Raised when admin operation fails."""
def __init__(
self,
operation: str,
reason: str,
target_type: Optional[str] = None,
target_id: Optional[str] = None,
self,
operation: str,
reason: str,
target_type: Optional[str] = None,
target_id: Optional[str] = None,
):
message = f"Admin operation '{operation}' failed: {reason}"
@@ -142,10 +139,10 @@ class InvalidAdminActionException(ValidationException):
"""Raised when admin action is invalid."""
def __init__(
self,
action: str,
reason: str,
valid_actions: Optional[list] = None,
self,
action: str,
reason: str,
valid_actions: Optional[list] = None,
):
details = {
"action": action,
@@ -166,11 +163,11 @@ class BulkOperationException(BusinessLogicException):
"""Raised when bulk admin operation fails."""
def __init__(
self,
operation: str,
total_items: int,
failed_items: int,
errors: Optional[Dict[str, Any]] = None,
self,
operation: str,
total_items: int,
failed_items: int,
errors: Optional[Dict[str, Any]] = None,
):
message = f"Bulk {operation} completed with errors: {failed_items}/{total_items} failed"
@@ -195,10 +192,10 @@ class ConfirmationRequiredException(BusinessLogicException):
"""Raised when a destructive operation requires explicit confirmation."""
def __init__(
self,
operation: str,
message: Optional[str] = None,
confirmation_param: str = "confirm"
self,
operation: str,
message: Optional[str] = None,
confirmation_param: str = "confirm",
):
if not message:
message = f"Operation '{operation}' requires confirmation parameter: {confirmation_param}=true"
@@ -217,10 +214,10 @@ class VendorVerificationException(BusinessLogicException):
"""Raised when vendor verification fails."""
def __init__(
self,
vendor_id: int,
reason: str,
current_verification_status: Optional[bool] = None,
self,
vendor_id: int,
reason: str,
current_verification_status: Optional[bool] = None,
):
details = {
"vendor_id": vendor_id,