Merge branch 'fs#151-normalize-article-titles-anchor' into develop
This commit is contained in:
@@ -186,25 +186,32 @@ class MarkPagesBot( CurrentPageBot ): # sets 'current_page' on each treat()
|
|||||||
# None if change was not accepted by user
|
# None if change was not accepted by user
|
||||||
save_ret = self.put_current( self.new_text, summary=summary )
|
save_ret = self.put_current( self.new_text, summary=summary )
|
||||||
|
|
||||||
|
# Normalize title with anchor (replace spaces in anchor)
|
||||||
|
article = self.current_page.title(withNamespace=False)
|
||||||
|
article_parts = article.split("#", 1)
|
||||||
|
if len(article_parts) == 2:
|
||||||
|
article_parts[1] = article_parts[1].replace(" ", "_")
|
||||||
|
article = "#".join(article_parts)
|
||||||
|
|
||||||
# Status
|
# Status
|
||||||
if add_ret is None or ( add_ret and save_ret ):
|
if add_ret is None or ( add_ret and save_ret ):
|
||||||
self.current_page.redfam.article_remove_status(
|
self.current_page.redfam.article_remove_status(
|
||||||
"note_rej",
|
"note_rej",
|
||||||
title=self.current_page.title(withNamespace=False))
|
title=article)
|
||||||
self.current_page.redfam.article_remove_status(
|
self.current_page.redfam.article_remove_status(
|
||||||
"sav_err",
|
"sav_err",
|
||||||
title=self.current_page.title(withNamespace=False))
|
title=article)
|
||||||
self.current_page.redfam.article_add_status(
|
self.current_page.redfam.article_add_status(
|
||||||
"marked",
|
"marked",
|
||||||
title=self.current_page.title(withNamespace=False))
|
title=article)
|
||||||
elif save_ret is None:
|
elif save_ret is None:
|
||||||
self.current_page.redfam.article_add_status(
|
self.current_page.redfam.article_add_status(
|
||||||
"note_rej",
|
"note_rej",
|
||||||
title=self.current_page.title(withNamespace=False))
|
title=article)
|
||||||
else:
|
else:
|
||||||
self.current_page.redfam.article_add_status(
|
self.current_page.redfam.article_add_status(
|
||||||
"sav_err",
|
"sav_err",
|
||||||
title=self.current_page.title(withNamespace=False))
|
title=article)
|
||||||
|
|
||||||
def add_disc_notice_template( self ):
|
def add_disc_notice_template( self ):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user