You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/categories/bisonte/cabeza/carrillera/
Django Version: 1.6.5
Python Version: 2.7.5
Installed Applications:
('grappelli',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'categories',
'categories.editor')
Installed Middleware:
(u'debug_toolbar.middleware.DebugToolbarMiddleware',
'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 "/Users/Downloads/pytesting/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
112. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/Users/Downloads/devel/project-core/core_categories/categories/views.py" in category_detail
27. parent__slug__iexact=path_items[-2])
File "/Users/Downloads/pytesting/lib/python2.7/site-packages/django/shortcuts/__init__.py" in get_object_or_404
113. return queryset.get(*args, **kwargs)
File "/Users/Downloads/pytesting/lib/python2.7/site-packages/django/db/models/query.py" in get
313. (self.model._meta.object_name, num))
Exception Type: MultipleObjectsReturned at /categories/bisonte/cabeza/carrillera/
Exception Value: get() returned more than one Category -- it returned 2!
The issue is that the URL for /categories/bisonte/cabeza/carrillera/ and categories/toro/cabeza/carrillera/ share the same level 2 and leve 3 slugs, so the code at category_detail fails since there are more than 1 category that meets the criteria. The code at view.py:category_detail reveals there is a hardcode search for only two levels up the category path.
Thanks to a reference at stackoverflow.com I found a solution to it. I am preparing a pull request.
The text was updated successfully, but these errors were encountered:
I have found a bug. Let's say that you have the following taxonomy (sorry for the Spanish):
The second and third levels share the same names. So when you navigate to the page of a category in the third level (http://127.0.0.1:8000/categories/bisonte/cabeza/carrillera/), you get an error like:
The issue is that the URL for
/categories/bisonte/cabeza/carrillera/
andcategories/toro/cabeza/carrillera/
share the same level 2 and leve 3 slugs, so the code at category_detail fails since there are more than 1 category that meets the criteria. The code at view.py:category_detail reveals there is a hardcode search for only two levels up the category path.Thanks to a reference at stackoverflow.com I found a solution to it. I am preparing a pull request.
The text was updated successfully, but these errors were encountered: