Exception fix

cc @lukmdo @trepca @iserko 

This is for Django 1.6 compat.