get() returned more than one Company -- it returned 2!
Request Method: | GET |
---|---|
Request URL: | http://www.fast-torrent.ru/company/walt-disney-productions/ |
Django Version: | 4.1.1 |
Exception Type: | MultipleObjectsReturned |
Exception Value: | get() returned more than one Company -- it returned 2! |
Exception Location: | ./venv/lib/python3.10/site-packages/django/db/models/query.py, line 653, in get |
Python Executable: | /usr/bin/uwsgi-core |
Python Version: | 3.10.12 |
Python Path: | ['.', '', '/lib/python310.zip', '/lib/python3.10', '/lib/python3.10/lib-dynload', './venv/lib/python3.10/site-packages'] |
Server time: | Tue, 19 Mar 2024 03:28:03 +0000 |
./venv/lib/python3.10/site-packages/django/core/handlers/exception.py
, line 55, in inner
return inner
else:
@wraps(get_response)
def inner(request):
try:
response = get_response(request)…
except Exception as exc:
response = response_for_exception(request, exc)
return response
return inner
Variable | Value |
---|---|
exc | MultipleObjectsReturned('get() returned more than one Company -- it returned 2!') |
get_response | <bound method BaseHandler._get_response of <django.core.handlers.wsgi.WSGIHandler object at 0x7f99a24e37f0>> |
request | <WSGIRequest: GET '/company/walt-disney-productions/'> |
./venv/lib/python3.10/site-packages/django/core/handlers/base.py
, line 197, in _get_response
if response is None:
wrapped_callback = self.make_view_atomic(callback)
# If it is an asynchronous view, run it in a subthread.
if asyncio.iscoroutinefunction(wrapped_callback):
wrapped_callback = async_to_sync(wrapped_callback)
try:
response = wrapped_callback(request, *callback_args, **callback_kwargs)…
except Exception as e:
response = self.process_exception_by_middleware(e, request)
if response is None:
raise
# Complain if the view returned None (a common error).
Variable | Value |
---|---|
callback | <function company at 0x7f99a20f5630> |
callback_args | () |
callback_kwargs | {'slug': 'walt-disney-productions'} |
middleware_method | <bound method CsrfViewMiddleware.process_view of <CsrfViewMiddleware get_response=convert_exception_to_response.<locals>.inner>> |
request | <WSGIRequest: GET '/company/walt-disney-productions/'> |
response | None |
self | <django.core.handlers.wsgi.WSGIHandler object at 0x7f99a24e37f0> |
wrapped_callback | <function company at 0x7f99a20f5630> |
./venv/lib/python3.10/site-packages/django/views/decorators/csrf.py
, line 54, in wrapped_view
def csrf_exempt(view_func):
"""Mark a view function as being exempt from the CSRF view protection."""
# view_func.csrf_exempt = True would also work, but decorators are nicer
# if they don't have side effects, so return a new function.
def wrapped_view(*args, **kwargs):
return view_func(*args, **kwargs)…
wrapped_view.csrf_exempt = True
return wraps(view_func)(wrapped_view)
Variable | Value |
---|---|
args | (<WSGIRequest: GET '/company/walt-disney-productions/'>,) |
kwargs | {'slug': 'walt-disney-productions'} |
view_func | <function company at 0x7f99a20f55a0> |
././film/views.py
, line 471, in company
@csrf_exempt
def voice( request, slug, slug1='' ):
return film_parser( request, 'all', 'voice', slug, 1 )
@csrf_exempt
def company( request, slug, page=1 ):
return film_parser( request, 'tv', 'company', slug, page )…
@csrf_exempt
def channel( request, slug, page=1 ):
return film_parser( request, 'all', 'channel', slug, page )
def genre_parser ( request, slug, type, page=1, tag=False, country=False, year=False ):
Variable | Value |
---|---|
page | 1 |
request | <WSGIRequest: GET '/company/walt-disney-productions/'> |
slug | 'walt-disney-productions' |
./venv/lib/python3.10/site-packages/django/views/decorators/csrf.py
, line 54, in wrapped_view
def csrf_exempt(view_func):
"""Mark a view function as being exempt from the CSRF view protection."""
# view_func.csrf_exempt = True would also work, but decorators are nicer
# if they don't have side effects, so return a new function.
def wrapped_view(*args, **kwargs):
return view_func(*args, **kwargs)…
wrapped_view.csrf_exempt = True
return wraps(view_func)(wrapped_view)
Variable | Value |
---|---|
args | (<WSGIRequest: GET '/company/walt-disney-productions/'>, 'tv', 'company', 'walt-disney-productions', 1) |
kwargs | {} |
view_func | <function film_parser at 0x7f99a20f5900> |
././film/views.py
, line 594, in film_parser
if type == 'genre':
url_path = get_object_or_404( Genre, slug=slug )
elif type == 'studio':
url_path = get_object_or_404( Studio, slug=slug )
elif type == 'company':
url_path = get_object_or_404( Company, slug=slug )…
elif type == 'channel':
url_path = get_object_or_404( Channel, slug=slug )
elif type in ( 'celebrity', 'director', 'actor' ):
# print 'celebrity', slug
if Celebrity.objects.filter( slug=slug ).count():
url_path = Celebrity.objects.filter( slug=slug ).order_by( 'id' )[0]
Variable | Value |
---|---|
content_legal | False |
hide_viewed | False |
list_content_prefix | 'list_content_1' |
m | None |
mode | 'tv' |
page | 1 |
pages | '15' |
profile | False |
request | <WSGIRequest: GET '/company/walt-disney-productions/'> |
selected_country | False |
selected_genre | False |
selected_tag | False |
selected_year | False |
set_hide_viewed | False |
slug | 'walt-disney-productions' |
sort | '6' |
type | 'company' |
url_path | <Type: Сериалы> |
./venv/lib/python3.10/site-packages/django/shortcuts.py
, line 85, in get_object_or_404
klass.__name__ if isinstance(klass, type) else klass.__class__.__name__
)
raise ValueError(
"First argument to get_object_or_404() must be a Model, Manager, "
"or QuerySet, not '%s'." % klass__name
)
try:
return queryset.get(*args, **kwargs)…
except queryset.model.DoesNotExist:
raise Http404(
"No %s matches the given query." % queryset.model._meta.object_name
)
Variable | Value |
---|---|
args | () |
klass | <class 'film.models.Company'> |
kwargs | {'slug': 'walt-disney-productions'} |
queryset | <QuerySet [<Company: "G" P.C. S.A.>, <Company: "Hanochi" Film Partners>, <Company: "Mega" Marbella Entertainment Groups & Artists>, <Company: "Weathering With You" Film Partners>, <Company: "Yeni Film" Film Company>, <Company: "ქართული ფილმი">, <Company: # Andrea Sperling Productions>, <Company: #Sinning Works>, <Company: #littlesecretfilm>, <Company: (주)라인필름>, <Company: , Helen Winston Productions>, <Company: , Planet Productions>, <Company: ,Wyndcross>, <Company: .Mille et Une. Films.>, <Company: .hack Conglomerate>, <Company: 01 Distribution>, <Company: 011Films>, <Company: 02 Filmes>, <Company: 03 Medya>, <Company: 1 Aprile Cinematografica>, '...(remaining elements truncated)...']> |
./venv/lib/python3.10/site-packages/django/db/models/query.py
, line 653, in get
num = len(clone)
if num == 1:
return clone._result_cache[0]
if not num:
raise self.model.DoesNotExist(
"%s matching query does not exist." % self.model._meta.object_name
)
raise self.model.MultipleObjectsReturned(…
"get() returned more than one %s -- it returned %s!"
% (
self.model._meta.object_name,
num if not limit or num < limit else "more than %s" % (limit - 1),
)
)
Variable | Value |
---|---|
args | () |
clone | <QuerySet [<Company: Walt Disney Productions>, <Company: Walt Disney>]> |
kwargs | {'slug': 'walt-disney-productions'} |
limit | 21 |
num | 2 |
self | <QuerySet [<Company: "G" P.C. S.A.>, <Company: "Hanochi" Film Partners>, <Company: "Mega" Marbella Entertainment Groups & Artists>, <Company: "Weathering With You" Film Partners>, <Company: "Yeni Film" Film Company>, <Company: "ქართული ფილმი">, <Company: # Andrea Sperling Productions>, <Company: #Sinning Works>, <Company: #littlesecretfilm>, <Company: (주)라인필름>, <Company: , Helen Winston Productions>, <Company: , Planet Productions>, <Company: ,Wyndcross>, <Company: .Mille et Une. Films.>, <Company: .hack Conglomerate>, <Company: 01 Distribution>, <Company: 011Films>, <Company: 02 Filmes>, <Company: 03 Medya>, <Company: 1 Aprile Cinematografica>, '...(remaining elements truncated)...']> |
AnonymousUser
No GET data
No POST data
No FILES data
No cookie data
Variable | Value |
---|---|
CONTENT_LENGTH | '' |
CONTENT_TYPE | '' |
DOCUMENT_ROOT | '/etc/nginx/html' |
HTTP_ACCEPT | '*/*' |
HTTP_CONNECTION | 'close' |
HTTP_HOST | 'www.fast-torrent.ru' |
HTTP_USER_AGENT | 'claudebot' |
HTTP_X_FORWARDED_FOR | '54.221.159.188' |
HTTP_X_REAL_IP | '54.221.159.188' |
PATH_INFO | '********************' |
QUERY_STRING | '' |
REMOTE_ADDR | '45.142.212.135' |
REMOTE_PORT | '37236' |
REQUEST_METHOD | 'GET' |
REQUEST_SCHEME | 'http' |
REQUEST_URI | '/company/walt-disney-productions/' |
SCRIPT_NAME | '' |
SERVER_NAME | 'www.fast-torrent.ru' |
SERVER_PORT | '80' |
SERVER_PROTOCOL | 'HTTP/1.0' |
Setting | Value |
---|
You’re seeing this error because you have DEBUG = True
in your
Django settings file. Change that to False
, and Django will
display a standard page generated by the handler for this status code.