saving issue fixed
This commit is contained in:
+8
-6
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user