Replace loop in web.py with generator expression

Co-Authored-By: Glandos <bugs-github@antipoul.fr>
This commit is contained in:
Andrew Dickinson 2020-04-13 19:35:52 -04:00 committed by GitHub
parent e7848e39c6
commit 5cc8b5a68c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -750,11 +750,7 @@ def history():
"""Query for the version entries associated with this project.""" """Query for the version entries associated with this project."""
history = get_history(g.project, human_readable_names=True) history = get_history(g.project, human_readable_names=True)
any_ip_addresses = False any_ip_addresses = any(event["ip"] for event in history)
for event in history:
if event["ip"]:
any_ip_addresses = True
break
return render_template( return render_template(
"history.html", "history.html",