Skip to content

Commit

Permalink
Simplify multi-condition if
Browse files Browse the repository at this point in the history
  • Loading branch information
barthalion committed Feb 8, 2025
1 parent d557b53 commit 196df7d
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions backend/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,9 @@ def get_summary(
app = models.App.by_appid(db_session, app_id)
if app and app.summary:
summary = app.summary
if (
"metadata" in summary
and summary["metadata"]
and "runtime" in summary["metadata"]
):
metadata = summary.get("metadata", {})

if "runtime" in metadata:
runtime_appid, _, runtime_branch = summary["metadata"]["runtime"].split(
"/"
)
Expand All @@ -440,11 +438,8 @@ def get_summary(
if branch:
key = f"summary:{app_id}:{branch}"
if summary := db.get_json_key(key):
if (
"metadata" in summary
and summary["metadata"]
and "runtime" in summary["metadata"]
):
metadata = summary.get("metadata", {})
if "runtime" in metadata:
runtime_appid, _, runtime_branch = summary["metadata"]["runtime"].split(
"/"
)
Expand Down

0 comments on commit 196df7d

Please sign in to comment.