diff options
author | luxagraf <sng@luxagraf.net> | 2024-01-17 15:37:45 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2024-01-17 15:37:45 -0500 |
commit | 635c3b970a2c68e02772dd493e4013703ef58af6 (patch) | |
tree | ff1f32148f4b80b1760cbe35dfb7bd9539324e53 /app/gtd/models.py | |
parent | 1e362aad0f890221b7d5529dce01bb34d8f3282d (diff) |
gtd: fixed a bug in update code
Diffstat (limited to 'app/gtd/models.py')
-rw-r--r-- | app/gtd/models.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/gtd/models.py b/app/gtd/models.py index 9faa6b2..5eee8f2 100644 --- a/app/gtd/models.py +++ b/app/gtd/models.py @@ -193,19 +193,25 @@ class WiredPost(models.Model): def set_needs_update(self): """ figures out if a post needs to be update based on either - update frrquency or month-based schedule if there is one + update frequency or month-based schedule if there is one """ + self.needs_update = False if self.date_last_pub and not self.update_schedule.exists(): + print("no schedule") td = datetime.date.today() - self.date_last_pub if self.post_status == 0 or self.post_status == 2: if td.days > self.update_frequency: self.needs_update = True + print("setting update true") self.save() if self.update_schedule.exists(): + print("scheduled post") for m in self.update_schedule.all(): td = m.date - datetime.date.today() + print(self, td.days) if td.days <= 30: self.needs_update = True + print("setting update true") self.save() return '' |