From a2ca20d5b06f344aa2ca6bf3bc087960a5989f36 Mon Sep 17 00:00:00 2001 From: throwaway-of <74850355+throwaway-of@users.noreply.github.com> Date: Sun, 22 Nov 2020 01:53:00 -0500 Subject: [PATCH] Fix type error Fixing error: File "/usr/src/app/helpers/main_helper.py", line 272, in reformat maximum_length = maximum_length - int(directory_count+path_count+extra_count) TypeError: unsupported operand type(s) for -: 'str' and 'int' Seems like prepared_format.maximum_length is a string. --- helpers/main_helper.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpers/main_helper.py b/helpers/main_helper.py index a357933bd..5969d6934 100644 --- a/helpers/main_helper.py +++ b/helpers/main_helper.py @@ -235,7 +235,7 @@ def reformat(prepared_format, unformatted): date = prepared_format.date text = prepared_format.text value = "Free" - maximum_length = prepared_format.maximum_length + maximum_length = int(prepared_format.maximum_length) post_id = "" if post_id is None else str(post_id) media_id = "" if media_id is None else str(media_id) extra_count = 0