From fc78d1ee072f77984cd952afc022af995649cca5 Mon Sep 17 00:00:00 2001 From: bodybybuddha Date: Tue, 28 Aug 2018 19:22:17 -0400 Subject: [PATCH] Added exception catching for file format check --- cps/web.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cps/web.py b/cps/web.py index 9908de2f..843805d4 100644 --- a/cps/web.py +++ b/cps/web.py @@ -3186,7 +3186,10 @@ def edit_book(book_id): #Determine what formats don't already exist allowed_conversion_formats = ALLOWED_EXTENSIONS for file in book.data: - allowed_conversion_formats.remove(file.format.lower()) + try: + allowed_conversion_formats.remove(file.format.lower()) + except Exception: + app.logger.warning(file.formate.lower() + ' already removed from list.') app.logger.debug(allowed_conversion_formats)