BladeSzaSza Claude commited on
Commit
f4b3f9f
·
1 Parent(s): 5dda871

Fix import error: move AuthResult and User imports to module level

Browse files

- Move AuthResult, User imports from method level to module level
- Fixes NameError: name 'AuthResult' is not defined at import time
- Remove redundant imports inside _create_oauth_user method
- Ensures all type hints are properly resolved during module loading

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

Co-Authored-By: Claude <[email protected]>

Files changed (1) hide show
  1. digipal/ui/gradio_interface.py +1 -2
digipal/ui/gradio_interface.py CHANGED
@@ -16,7 +16,7 @@ import io
16
  from ..core.digipal_core import DigiPalCore, PetState
17
  from ..core.enums import EggType, LifeStage
18
  from ..auth.auth_manager import AuthManager
19
- from ..auth.models import AuthStatus
20
  from ..storage.database import DatabaseConnection
21
 
22
  logger = logging.getLogger(__name__)
@@ -641,7 +641,6 @@ class GradioInterface:
641
  def _create_oauth_user(self, user_id: str, username: str, oauth_info: Dict) -> Optional[AuthResult]:
642
  """Create or update user from OAuth information."""
643
  try:
644
- from ..auth.models import User, AuthResult, AuthStatus
645
  from datetime import datetime
646
 
647
  # Extract user data from OAuth info
 
16
  from ..core.digipal_core import DigiPalCore, PetState
17
  from ..core.enums import EggType, LifeStage
18
  from ..auth.auth_manager import AuthManager
19
+ from ..auth.models import AuthStatus, AuthResult, User
20
  from ..storage.database import DatabaseConnection
21
 
22
  logger = logging.getLogger(__name__)
 
641
  def _create_oauth_user(self, user_id: str, username: str, oauth_info: Dict) -> Optional[AuthResult]:
642
  """Create or update user from OAuth information."""
643
  try:
 
644
  from datetime import datetime
645
 
646
  # Extract user data from OAuth info