fix: Save last checked correctly
This commit is contained in:
parent
885622e581
commit
b4f52c7876
@ -351,18 +351,21 @@ class AdoptionNotice(models.Model):
|
|||||||
def set_closed(self):
|
def set_closed(self):
|
||||||
self.last_checked = timezone.now()
|
self.last_checked = timezone.now()
|
||||||
self.adoptionnoticestatus.set_closed()
|
self.adoptionnoticestatus.set_closed()
|
||||||
|
self.save()
|
||||||
|
|
||||||
def set_active(self):
|
def set_active(self):
|
||||||
self.last_checked = timezone.now()
|
self.last_checked = timezone.now()
|
||||||
if not hasattr(self, 'adoptionnoticestatus'):
|
if not hasattr(self, 'adoptionnoticestatus'):
|
||||||
AdoptionNoticeStatus.create_other(self)
|
AdoptionNoticeStatus.create_other(self)
|
||||||
self.adoptionnoticestatus.set_active()
|
self.adoptionnoticestatus.set_active()
|
||||||
|
self.save()
|
||||||
|
|
||||||
def set_unchecked(self):
|
def set_unchecked(self):
|
||||||
self.last_checked = timezone.now()
|
self.last_checked = timezone.now()
|
||||||
if not hasattr(self, 'adoptionnoticestatus'):
|
if not hasattr(self, 'adoptionnoticestatus'):
|
||||||
AdoptionNoticeStatus.create_other(self)
|
AdoptionNoticeStatus.create_other(self)
|
||||||
self.adoptionnoticestatus.set_unchecked()
|
self.adoptionnoticestatus.set_unchecked()
|
||||||
|
self.save()
|
||||||
|
|
||||||
|
|
||||||
class AdoptionNoticeStatus(models.Model):
|
class AdoptionNoticeStatus(models.Model):
|
||||||
|
Loading…
Reference in New Issue
Block a user