merge avec adrien ok

This commit is contained in:
CHIBOUB Chakib
2024-09-15 15:45:05 +02:00
6 changed files with 232 additions and 169 deletions

View File

@@ -69,6 +69,7 @@ def create_player(
m_duration=m_duration,
num_participated_tournaments=num_participated_tournaments,
num_won_tournaments=num_won_tournaments
)
player.save()
return player
@@ -132,7 +133,7 @@ def update_player_statistics(player_name):
total_score = matches_as_player1.aggregate(Sum('score_player1'))['score_player1__sum'] or 0
total_score += matches_as_player2.aggregate(Sum('score_player2'))['score_player2__sum'] or 0
total_score_adv = matches_as_player1.aggregate(Sum('score_player2'))['score_player2__sum'] or 0
total_score_adv += matches_as_player2.aggregate(Sum('score_player1'))['score_player1__sum'] or 0

View File

@@ -138,6 +138,32 @@ CHANNEL_LAYERS = {
},
}
LOGGING = {
'version': 1, # Django requires this key
'disable_existing_loggers': False, # Keep Django's default loggers
'formatters': {
'simple': {
'format': '{levelname} {message}',
'style': '{', # Allows to use Python's new style string formatting
},
},
'handlers': {
'console': { # Log to the console
'level': 'DEBUG', # Minimum level of messages that should be handled
'class': 'logging.StreamHandler',
'formatter': 'simple', # Use the simple formatter defined above
},
},
'loggers': {
'django': { # The main logger for Django itself
'handlers': ['console'],
'level': 'DEBUG', # Minimum log level to be logged
'propagate': False, # Prevents log propagation to other loggers
},
},
}
"""
LOGGING = {
'version': 1, # The version of the logging configuration schema
'disable_existing_loggers': False, # Allows existing loggers to keep logging
@@ -172,3 +198,4 @@ LOGGING = {
},
},
}
"""

View File

@@ -401,4 +401,4 @@ document.addEventListener('DOMContentLoaded', () => {
return color;
}
});
});