CivicSpleen / metaeditor

A Django application for eidting metadata of public datasets.
MIT License
1 stars 0 forks source link

IndexError at /editor/sources/: list index out of range #4

Closed ericbusboom closed 9 years ago

ericbusboom commented 9 years ago

Environment:

Request Method: GET Request URL: http://127.0.0.1:8000/editor/sources/

Django Version: 1.7.1 Python Version: 2.7.6 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'mptt', 'editor') Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware')

Traceback: File "/Library/Python/2.7/site-packages/django/core/handlers/base.py" in get_response

  1. response = wrapped_callback(request, _callback_args, *_callback_kwargs) File "/Users/eric/proj/metaeditor/editor/views.py" in sources
  2. root = Source.objects.filter(level=0)[0] File "/Library/Python/2.7/site-packages/django/db/models/query.py" in getitem
  3. return list(qs)[0]

Exception Type: IndexError at /editor/sources/ Exception Value: list index out of range

Pthinker commented 9 years ago

Please add some records in admin page first

ericbusboom commented 9 years ago

On Feb 24, 2015, at 10:57 AM, David Zhang notifications@github.com wrote:

Please add some records in admin page first

I can't. Adding sources requires a parent, and the first source added has no parent, so the admin page throws an error.

I can add Categories OK.

There used to be a migration that added the root for sources.

eric.


Eric Busboom (619) 363 2607
eric@busboom.org http://www.busboom.org

Pthinker commented 9 years ago

I already removed the requirement for that so you can add source/format/category in admin no matter there is record or not.

ericbusboom commented 9 years ago

On Feb 24, 2015, at 11:10 AM, David Zhang notifications@github.com wrote:

I already removed the requirement for that so you can add source/format/category in admin no matter there is record or not.

Oh, sorry, I misread which field was throwing the error.

eric.


Eric Busboom (619) 363 2607
eric@busboom.org http://www.busboom.org