in assets/assets/utils/common_utils.py [0:0]
def convert(self) -> Union[bool]:
"""
Checks if file format is in the available conversion formats.
"""
try:
if self.ext == ".html":
self.converted_file = self.convert_html()
if self.ext == ".pdf":
self.converted_file = self.convert_pdf()
if self.ext in settings.gotenberg_formats:
self.converted_file = self.convert_gotenberg_formats()
if self.ext in settings.image_formats:
self.converted_file = self.convert_to_jpg()
except exceptions.FileConversionError:
return False
except requests.exceptions.ConnectionError:
return False
return True