'Ensure that the flag is reset back to its original value.'

def restore_flag(self):

    Flag.objects.filter(name=self.flagname).delete()
    if (self.origflag is not None):
        self.origflag.id = self.origid
        self.origflag.save()
