From e904e1658a8e3054648b607a1c61e532e4bc38d1 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: May 05 2016 17:08:54 +0000 Subject: Fix the increment_largest_priority filter to work with the empty priority option --- diff --git a/pagure/ui/filters.py b/pagure/ui/filters.py index e3d7881..28357bd 100644 --- a/pagure/ui/filters.py +++ b/pagure/ui/filters.py @@ -400,11 +400,12 @@ def return_md5(text): m.update(text) return pagure.lib.clean_input(m.hexdigest()) + @APP.template_filter('increment_largest_priority') def text_wraps(dictionary): """ Template filter to return the largest priority +1 """ if dictionary: - return int(max(dictionary.keys(), key=int)) + 1 + return max([int(k) for k in dictionary if k]) + 1 else: return 1