'Make sure a doc\'s category is valid.'

def _clean_category(self):

    if ((not self.parent) and (self.category not in (id for (id, name) in CATEGORIES))):
        raise ValidationError(_('Please    choose    a    category.'))
    self._ensure_inherited_attr('category')
