def save(self, *args, **kwargs):
    if ((not self.id) and (not self.user)):
        self.key = self.get_random_key()
        self.status = self.UNCONFIRMED
    if ((self.status == self.CANCELLED) and (self.date_cancelled is None)):
        self.date_cancelled = timezone.now()
    if ((not self.user) and (self.status == self.ACTIVE) and (self.date_confirmed is None)):
        self.date_confirmed = timezone.now()
    if ((self.status == self.CLOSED) and (self.date_closed is None)):
        self.date_closed = timezone.now()
    return super().save(*args, **kwargs)
def save(self, *args, **kwargs):
    if ((not self.id) and (not self.user)):
        self.key = self.get_random_key()
        self.status = self.UNCONFIRMED
    if ((self.status == self.CANCELLED) and (self.date_cancelled is None)):
        self.date_cancelled = timezone.now()
    if ((not self.user) and (self.status == self.ACTIVE) and (self.date_confirmed is None)):
        self.date_confirmed = timezone.now()
    if ((self.status == self.CLOSED) and (self.date_closed is None)):
        self.date_closed = timezone.now()
    return super().save(*args, **kwargs)