diff --git a/bots/markpages.py b/bots/markpages.py index 5fdd701..63f6d23 100644 --- a/bots/markpages.py +++ b/bots/markpages.py @@ -186,25 +186,32 @@ class MarkPagesBot( CurrentPageBot ): # sets 'current_page' on each treat() # None if change was not accepted by user 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 if add_ret is None or ( add_ret and save_ret ): self.current_page.redfam.article_remove_status( "note_rej", - title=self.current_page.title(withNamespace=False)) + title=article) self.current_page.redfam.article_remove_status( "sav_err", - title=self.current_page.title(withNamespace=False)) + title=article) self.current_page.redfam.article_add_status( "marked", - title=self.current_page.title(withNamespace=False)) + title=article) elif save_ret is None: self.current_page.redfam.article_add_status( "note_rej", - title=self.current_page.title(withNamespace=False)) + title=article) else: self.current_page.redfam.article_add_status( "sav_err", - title=self.current_page.title(withNamespace=False)) + title=article) def add_disc_notice_template( self ): """