django_1 | Internal Server Error: /contest/
django_1 | Traceback (most recent call last):
django_1 | File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
django_1 | return self.cursor.execute(sql, params)
django_1 | psycopg2.errors.AmbiguousColumn: ORDER BY "best_score" is ambiguous
django_1 | LINE 1: ...am"."id", "contest_aggregatedscore"."id" ORDER BY "best_scor...
django_1 | ^
django_1 |
django_1 |
django_1 | The above exception was the direct cause of the following exception:
django_1 |
django_1 | Traceback (most recent call last):
django_1 | File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 34, in inner
django_1 | response = get_response(request)
django_1 | File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 115, in _get_response
django_1 | response = self.process_exception_by_middleware(e, request)
django_1 | File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 113, in _get_response
django_1 | response = wrapped_callback(request, *callback_args, **callback_kwargs)
django_1 | File "/usr/local/lib/python3.6/contextlib.py", line 52, in inner
django_1 | return func(*args, **kwds)
django_1 | File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
django_1 | return view_func(request, *args, **kwargs)
django_1 | File "/opt/app/isucon/portal/contest/decorators.py", line 11, in _function
django_1 | return function(request, *args, **kwargs)
django_1 | File "/opt/app/isucon/portal/contest/views.py", line 37, in dashboard
django_1 | top_teams = ScoreHistory.objects.get_top_teams()
django_1 | File "/opt/app/isucon/portal/contest/models.py", line 107, in get_top_teams
django_1 | return [history.team for history in histories]
django_1 | File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 274, in __iter__
django_1 | self._fetch_all()
django_1 | File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 1242, in _fetch_all
django_1 | self._result_cache = list(self._iterable_class(self))
django_1 | File "/usr/local/lib/python3.6/site-packages/django/db/models/query.py", line 55, in __iter__
django_1 | results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
django_1 | File "/usr/local/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1100, in execute_sql
django_1 | cursor.execute(sql, params)
django_1 | File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 99, in execute
django_1 | return super().execute(sql, params)
django_1 | File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 67, in execute
django_1 | return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
django_1 | File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 76, in _execute_with_wrappers
django_1 | return executor(sql, params, many, context)
django_1 | File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
django_1 | return self.cursor.execute(sql, params)
django_1 | File "/usr/local/lib/python3.6/site-packages/django/db/utils.py", line 89, in __exit__
django_1 | raise dj_exc_value.with_traceback(traceback) from exc_value
django_1 | File "/usr/local/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
django_1 | return self.cursor.execute(sql, params)
django_1 | django.db.utils.ProgrammingError: ORDER BY "best_score" is ambiguous
django_1 | LINE 1: ...am"."id", "contest_aggregatedscore"."id" ORDER BY "best_scor...
django_1 | ^
django_1 |