DarkHorseComics/django-mailer — pull request #1 by bschlief (2014-02-26 22:34:45+00:00)
Title: Handle IndexError

Statements such as:
Message.objects.medium_priority().order_by("when_added")[0]
can result in an Index Error. Presumably, the previous line's assertion that count() is nonzero should protect us from this possibility, but there the IndexError sits in my logfile, mocking me.