'Attempts to resurrect a previously added and invalidated object first
If the object being added has not been saved to the database
previously, then this logic is relevant and not executed.'

def save(self, *args, **kwargs):

    first_time = (self.id is None)
    if first_time:
        my_name = getattr(self, self.name_field)
        filters = {self.name_field: my_name, 'invalid': True}
        try:
            old_object = self.__class__.objects.get(**filters)
            self.resurrect_object(old_object)
        except self.DoesNotExist:
            pass
    super(ModelWithInvalid, self).save(*args, **kwargs)
