From 0663e8c9b6a8a1c501de38da1b2ea38a69b97fb4 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 1 Aug 2012 20:31:25 -0400 Subject: [PATCH] Add a rule to set status to NEEDASSIST if a case is NEW. --- earwigbot/tasks/drn_clerkbot.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/earwigbot/tasks/drn_clerkbot.py b/earwigbot/tasks/drn_clerkbot.py index 55bb3b2..18dd2d6 100644 --- a/earwigbot/tasks/drn_clerkbot.py +++ b/earwigbot/tasks/drn_clerkbot.py @@ -312,11 +312,16 @@ class DRNClerkBot(Task): def clerk_new_case(self, case, volunteers, signatures): """Clerk a case in the "brand new" state. - The case will be set to "open" if a volunteer edits it. + The case will be set to "open" if a volunteer edits it, or "needassist" + if it goes by without any volunteer edits for two days. """ notices = self.notify_parties(case) if any([editor in volunteers for (editor, timestamp) in signatures]): self.update_status(case, self.STATUS_OPEN) + else: + age = (datetime.utcnow() - case.file_time).total_seconds() + if age > 60 * 60 * 24 * 2: + self.update_status(case, self.STATUS_NEEDASSIST) return notices def clerk_open_case(self, case, signatures):