On http://world-diplomacy-database.com/php/results/player_fiche5.php?id_player=13317, the "Netherlands Diplomacy Championship 2017" has a date of "2017-09-0". This causes an exception in tournament/player.py where we try to save the PlayerTournamentRanking, because it is not a valid date.
django.core.exceptions.ValidationError: ["'2017-09-0' value has the correct format (YYYY-MM-DD) but it is an invalid date."]
We catch that exception, but then we still get another follow-on exception.
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/backends/utils.py" in _execute_with_wrappers
return executor(sql, params, many, context)
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/backends/utils.py" in _execute
self.db.validate_no_broken_transaction()
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/backends/base/base.py" in validate_no_broken_transaction
"An error occurred in the current transaction. You can't "
Exception Type: TransactionManagementError at /admin/tournament/player/112/change/
Exception Value: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.
On http://world-diplomacy-database.com/php/results/player_fiche5.php?id_player=13317, the "Netherlands Diplomacy Championship 2017" has a date of "2017-09-0". This causes an exception in tournament/player.py where we try to save the PlayerTournamentRanking, because it is not a valid date. django.core.exceptions.ValidationError: ["'2017-09-0' value has the correct format (YYYY-MM-DD) but it is an invalid date."] We catch that exception, but then we still get another follow-on exception.
Traceback: Environment:
Request Method: POST Request URL: https://diplomacytv.com/admin/tournament/player/112/change/
Django Version: 2.1.2 Python Version: 3.5.2 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.humanize', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'tournament', 'django_extensions', 'cachalot') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware')
Traceback:
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/handlers/exception.py" in inner
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/core/handlers/base.py" in _get_response
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/contrib/admin/options.py" in wrapper
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapped_view
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/contrib/admin/sites.py" in inner
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/contrib/admin/options.py" in change_view
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapper
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/utils/decorators.py" in _wrapped_view
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/contrib/admin/options.py" in changeform_view
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/contrib/admin/options.py" in _changeform_view
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/contrib/admin/options.py" in log_change
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/contrib/admin/models.py" in log_action
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/manager.py" in manager_method
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/query.py" in create
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/base.py" in save
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/base.py" in save_base
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/base.py" in _save_table
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/base.py" in _do_insert
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/manager.py" in manager_method
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/query.py" in _insert
File "/home/ubuntu/.local/lib/python3.5/site-packages/cachalot/monkey_patch.py" in inner
File "/home/ubuntu/.local/lib/python3.5/site-packages/cachalot/monkey_patch.py" in inner
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/models/sql/compiler.py" in execute_sql
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
File "/home/ubuntu/.local/lib/python3.5/site-packages/cachalot/monkey_patch.py" in inner
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/backends/utils.py" in execute
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/backends/utils.py" in _execute_with_wrappers
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/backends/utils.py" in _execute
File "/home/ubuntu/.local/lib/python3.5/site-packages/django/db/backends/base/base.py" in validate_no_broken_transaction
Exception Type: TransactionManagementError at /admin/tournament/player/112/change/ Exception Value: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block.