Enhance type safety in version control system by adding UserModel TypeVar, improving type hints in managers.py and utils.py, and ensuring consistent type imports.

This commit is contained in:
pacnpal
2025-02-06 20:35:30 -05:00
parent d3141ab320
commit ea582d799c
3 changed files with 129 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
from typing import Dict, Any, List, Optional, TypeVar, Type, Union, cast
from typing import Dict, Any, List, Optional, TypeVar, Type, cast
from django.core.exceptions import ValidationError
from .models import VersionBranch, ChangeSet
from django.utils import timezone
@@ -14,6 +14,7 @@ def _handle_source_target_resolution(change: ChangeSet) -> Dict[str, Any]:
for record in change.historical_records.all():
resolved[f"{record.instance_type}_{record.instance_pk}"] = record
return resolved
def _handle_manual_resolution(
conflict_id: str,
source_change: ChangeSet,