Change nested if to top level.

This commit is contained in:
Joaquin 2020-10-10 20:10:21 -05:00 committed by Jonathan Wren
parent 80c66eefbe
commit 807af778a2
No known key found for this signature in database
GPG key ID: 43D5FF8722E7F68A

View file

@ -300,11 +300,8 @@ def _display_search_results(args, journal, **kwargs):
elif args.export:
exporter = plugins.get_exporter(args.export)
print(exporter.export(journal, args.filename))
elif kwargs["config"].get("display_format"):
exporter = plugins.get_exporter(kwargs["config"]["display_format"])
print(exporter.export(journal, args.filename))
else:
# Display according display_format config option
config_selected = kwargs["config"].get("display_format")
exporter = plugins.get_exporter(config_selected)
if config_selected:
print(exporter.export(journal, args.filename))
else:
print(journal.pprint())
print(journal.pprint())