Browse Source

Fix a logic issue.

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

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

@@ -293,7 +293,8 @@ class DRNClerkBot(Task):
return notices return notices


def clerk_open_case(self, case, signatures): def clerk_open_case(self, case, signatures):
self.check_for_review(case)
if self.check_for_review(case):
return []
if len(case.body) - case.last_volunteer_size > 15000: if len(case.body) - case.last_volunteer_size > 15000:
if case.last_action != self.STATUS_NEEDASSIST: if case.last_action != self.STATUS_NEEDASSIST:
case.status = self.STATUS_NEEDASSIST case.status = self.STATUS_NEEDASSIST
@@ -305,14 +306,16 @@ class DRNClerkBot(Task):
return [] return []


def clerk_needassist_case(self, case, volunteers, newsigs): def clerk_needassist_case(self, case, volunteers, newsigs):
self.check_for_review(case)
if self.check_for_review(case):
return []
if any([editor in volunteers for (editor, timestamp) in newsigs]): if any([editor in volunteers for (editor, timestamp) in newsigs]):
if case.last_action != self.STATUS_OPEN: if case.last_action != self.STATUS_OPEN:
case.status = self.STATUS_OPEN case.status = self.STATUS_OPEN
return [] return []


def clerk_stale_case(self, case, newsigs): def clerk_stale_case(self, case, newsigs):
self.check_for_review(case)
if self.check_for_review(case):
return []
if newsigs: if newsigs:
if case.last_action != self.STATUS_OPEN: if case.last_action != self.STATUS_OPEN:
case.status = self.STATUS_OPEN case.status = self.STATUS_OPEN
@@ -351,6 +354,8 @@ class DRNClerkBot(Task):
if age > 60 * 60 * 24 * 4: if age > 60 * 60 * 24 * 4:
if case.last_action != self.STATUS_REVIEW: if case.last_action != self.STATUS_REVIEW:
case.status = self.STATUS_REVIEW case.status = self.STATUS_REVIEW
return True
return False


def read_signatures(self, text): def read_signatures(self, text):
regex = r"\[\[(?:User(?:\stalk)?\:|Special\:Contributions\/)" regex = r"\[\[(?:User(?:\stalk)?\:|Special\:Contributions\/)"


Loading…
Cancel
Save