mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
documentation: Avoid potential unused variable code path.
These variables can be unset if the `os.path.exists` check fails. That should be rare, since we've previously checked the files do exist before getting here.
This commit is contained in:
@@ -145,6 +145,8 @@ class MarkdownDirectoryView(ApiURLView):
|
|||||||
# The following is a somewhat hacky approach to extract titles from articles.
|
# The following is a somewhat hacky approach to extract titles from articles.
|
||||||
# Hack: `context["article"] has a leading `/`, so we use + to add directories.
|
# Hack: `context["article"] has a leading `/`, so we use + to add directories.
|
||||||
article_path = os.path.join(settings.DEPLOY_ROOT, "templates") + context["article"]
|
article_path = os.path.join(settings.DEPLOY_ROOT, "templates") + context["article"]
|
||||||
|
endpoint_name = None
|
||||||
|
endpoint_method = None
|
||||||
if os.path.exists(article_path):
|
if os.path.exists(article_path):
|
||||||
with open(article_path) as article_file:
|
with open(article_path) as article_file:
|
||||||
first_line = article_file.readlines()[0]
|
first_line = article_file.readlines()[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user