saving issue fixed

This commit is contained in:
bl3kunja-FW
2025-11-11 17:34:42 +01:00
parent 23dc5673ee
commit fd44ca7128
4 changed files with 58 additions and 24 deletions
+8 -6
View File
@@ -171,7 +171,7 @@ class ArchiveStorage(FileStorage):
@staticmethod
def archive_tournament(tournament_data, results_data):
"""Archive completed tournament data"""
"""Archive completed tournament data. Returns (success, filename) tuple"""
try:
FileStorage._ensure_directory(ARCHIVE_DIR)
@@ -188,14 +188,15 @@ class ArchiveStorage(FileStorage):
success = FileStorage._write_json(archive_path, archive_data)
if success:
print(f"Tournament archived to: {archive_path}")
return success
return (True, archive_filename)
return (False, None)
except Exception as e:
print(f"Error archiving tournament: {e}")
return False
return (False, None)
@staticmethod
def archive_league(league_data):
"""Archive completed league data"""
"""Archive completed league data. Returns (success, filename) tuple"""
try:
FileStorage._ensure_directory(LEAGUE_ARCHIVE_DIR)
@@ -211,10 +212,11 @@ class ArchiveStorage(FileStorage):
success = FileStorage._write_json(archive_path, archive_data)
if success:
print(f"League archived to: {archive_path}")
return success
return (True, archive_filename)
return (False, None)
except Exception as e:
print(f"Error archiving league: {e}")
return False
return (False, None)
@staticmethod
def get_archived_tournaments():