Permalink
Browse files

PermClerk: fix duplicate decrementing of open requests

Always attempt to autorespond

Remove lingering binding.pry
  • Loading branch information...
MusikAnimal committed May 9, 2018
1 parent 8aee33e commit 3fe79bc9620dda41f3c7c58144ab0e0e1d797cfd
Showing with 9 additions and 6 deletions.
  1. +9 −6 tasks/perm_clerk.rb
View
@@ -183,18 +183,23 @@ def self.process_section(section)
@open_timestamps << timestamps.min { |a, b| @mb.parse_date(a) <=> @mb.parse_date(b) }
@should_update_prereq_data = should_update_prereq_data
if @section.match(/{{comment\|Automated comment}}.*MusikBot/) && !@should_update_prereq_data
if @section.match(/\{\{comment\|Automated comment\}\}.*MusikBot/) && !@should_update_prereq_data
info(" MusikBot has already commented on #{username}'s request and no prerequisite data to update")
@new_wikitext << SPLIT_KEY + @section
return
# We still want to do the autorespond task.
if autorespond
return queue_changes
else
@new_wikitext << SPLIT_KEY + @section
return
end
end
# these tasks have already been ran if we're just updating prereq data
unless @should_update_prereq_data
# autoformat first, especially the case for Confirmed where they have a malformed report and are already autoconfirmed
autoformat
if autorespond
@num_open_requests -= 1
return queue_changes
end
fetch_declined
@@ -318,8 +323,6 @@ def self.autoformat
info(" Found improperly formatted request for #{@username}, repairing")
binding.pry
actual_reason = fragmented_match.flatten[1]
if actual_reason.empty? && @headers_removed[@username]
actual_reason = @headers_removed[@username]

0 comments on commit 3fe79bc

Please sign in to comment.