Browse Source

Add a rule to set status to NEEDASSIST if a case is NEW.

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

+ 6
- 1
earwigbot/tasks/drn_clerkbot.py View File

@@ -312,11 +312,16 @@ class DRNClerkBot(Task):
def clerk_new_case(self, case, volunteers, signatures): def clerk_new_case(self, case, volunteers, signatures):
"""Clerk a case in the "brand new" state. """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) notices = self.notify_parties(case)
if any([editor in volunteers for (editor, timestamp) in signatures]): if any([editor in volunteers for (editor, timestamp) in signatures]):
self.update_status(case, self.STATUS_OPEN) 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 return notices


def clerk_open_case(self, case, signatures): def clerk_open_case(self, case, signatures):


Loading…
Cancel
Save