You want to use [`.exists()`](https://docs.djangoproject.com/en/1.5/ref/models/querysets/#django.db.models.query.QuerySet.exists) here, it is more efficient and prevents the need for the IndexError.