def reset(self, save=False): self.secret = create_auto_secret() self.short_secret = create_auto_short_secret() self.dt_commit = None self.dt_expire = expire() if save: self.save()
def __init__(self, *args, **kwargs): super(Provision, self).__init__(*args, **kwargs) self.dt_expire = self.dt_expire or expire() self.secret = self.secret or create_auto_secret() self.short_secret = self.short_secret or create_auto_short_secret()