Skip to content

Commit 347dceb

Browse files
committed
Only error if redirect is different
1 parent 1663e9a commit 347dceb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

doc/sphinxext/redirect_from.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ def run(self):
9494
domain = self.env.get_domain('redirect_from')
9595
current_doc = self.env.path2doc(self.state.document.current_source)
9696
redirected_reldoc, _ = self.env.relfn2path(redirected_doc, current_doc)
97-
if redirected_reldoc in domain.redirects:
97+
if (redirected_reldoc in domain.redirects
98+
and domain.redirects[redirected_reldoc] != current_doc):
9899
raise ValueError(
99100
f"{redirected_reldoc} is already noted as redirecting to "
100101
f"{domain.redirects[redirected_reldoc]}")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy