Commit fe98b5dd by lwilms

change to accept less than 5 elements

parent 2471c1f4
......@@ -84,7 +84,7 @@ def create_jinja_environment(templates_to_use='default'):
def get_five_longest_entries(summary, top=5):
sorted_summary = dict()
if len(summary) < 6:
if len(summary) < top+1:
return summary
for key in sorted(summary, key=lambda key: len(summary[key]), reverse=True):
sorted_summary.update({key: summary[key]})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment