Browse Source

Fixing bug when there are no signatures.

tags/v0.1^2
Ben Kurtovic 12 years ago
parent
commit
1d79f6f42e
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      earwigbot/tasks/drn_clerkbot.py

+ 8
- 4
earwigbot/tasks/drn_clerkbot.py View File

@@ -347,9 +347,10 @@ class DRNClerkBot(Task):
if len(case.body) - case.last_volunteer_size > 15000: if len(case.body) - case.last_volunteer_size > 15000:
self.update_status(case, self.STATUS_NEEDASSIST) self.update_status(case, self.STATUS_NEEDASSIST)
timestamps = [timestamp for (editor, timestamp) in signatures] timestamps = [timestamp for (editor, timestamp) in signatures]
age = (datetime.utcnow() - max(timestamps)).total_seconds()
if age > 60 * 60 * 24 * 2:
self.update_status(case, self.STATUS_STALE)
if timestamps:
age = (datetime.utcnow() - max(timestamps)).total_seconds()
if age > 60 * 60 * 24 * 2:
self.update_status(case, self.STATUS_STALE)
return [] return []


def clerk_needassist_case(self, case, volunteers, newsigs): def clerk_needassist_case(self, case, volunteers, newsigs):
@@ -412,7 +413,10 @@ class DRNClerkBot(Task):
return return
timestamps = [timestamp for (editor, timestamp) in signatures] timestamps = [timestamp for (editor, timestamp) in signatures]
closed_age = (datetime.utcnow() - case.close_time).total_seconds() closed_age = (datetime.utcnow() - case.close_time).total_seconds()
modify_age = (datetime.utcnow() - max(timestamps)).total_seconds()
if timestamps:
modify_age = (datetime.utcnow() - max(timestamps)).total_seconds()
else:
modify_age = 0
if closed_age > 60 * 60 * 24 and modify_age > 60 * 60 * 24: if closed_age > 60 * 60 * 24 and modify_age > 60 * 60 * 24:
arch_top = self.tl_archive_top arch_top = self.tl_archive_top
arch_bottom = self.tl_archive_bottom arch_bottom = self.tl_archive_bottom


Loading…
Cancel
Save