fix: extension extracted if at least one dot, because if not dot (#19946) (#20142)

(cherry picked from commit 53c41e0ce6bf9985786a570c43fd32c79332c44c)

Co-authored-by: Jaime <developmentforpeople@gmail.com>
This commit is contained in:
mergify[bot] 2023-02-23 15:03:11 +05:30 committed by GitHub
parent d978450a15
commit 3a130abfc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ class StaticPage(BaseRenderer):
return self.is_valid_file_path() and self.file_path
def is_valid_file_path(self):
extension = self.path.rsplit(".", 1)[-1]
extension = self.path.rsplit(".", 1)[-1] if "." in self.path else ""
if extension in UNSUPPORTED_STATIC_PAGE_TYPES:
return False
return True