The .filter is returning a queryset with 2 records - if you apply .get() to this it will throw an exception (must be a queryset with 1 result) - iexact is a case insensitive search and thus why it's grabbing both values.
Request Method: GET
Django Version: 1.6.2
Python Version: 2.7.3
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
'django.contrib.staticfiles',
'social.apps.django_app.default')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware')
Traceback:
File "/usr/local/django-1.6.2/lib/python/django/core/handlers/base.py" in get_response
114. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/nova/nova/astrometry/net/views/image.py" in index_tag
617. tag = Tag.objects.filter(text__iexact=query).get()
File "/usr/local/django-1.6.2/lib/python/django/db/models/query.py" in get
310. (self.model._meta.object_name, num))
Exception Type: MultipleObjectsReturned at /user_images/tag
Exception Value: get() returned more than one Tag -- it returned 2!