Skip to content

Commit

Permalink
Fix bug in replace
Browse files Browse the repository at this point in the history
  • Loading branch information
mbenguigui committed Aug 29, 2023
1 parent 5b677ee commit f54690e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions protect_requests.py
Expand Up @@ -39,12 +39,13 @@ def close_dpp(section_content, article, admin, protect):
section_content = section_content.replace(end_section, message) + end_section

match = u'{{DPP début|statut=|date=<!--~~~~~-->}}'
replace = u'{{DPP début|statut=oui|date=<!--~~~~~-->}}'
if section_content.find(match) == -1:
match = u'{{DPP début|statut=attente'
replace = u'{{DPP début|statut=attente'
replace = u'{{DPP début|statut=oui'
if section_content.find(match) == -1:
match = u'{{DPP début|statut=autre'
replace = u'{{DPP début|statut=autre'
replace = u'{{DPP début|statut=oui'
if section_content.find(match) == -1:
return True, section_content
section_content = section_content.replace(match, replace, 1)
Expand Down

0 comments on commit f54690e

Please sign in to comment.