Skip to content

Commit af4ca42

Browse files
authored
Line indent/GitHub stars (#1186)
* set GitHub stars default during app build * get GitHub stars fix --------- Co-authored-by: pourhakimi <[email protected]>
1 parent 7840c82 commit af4ca42

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pcweb/github.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111

1212
def get_stars_on_build():
1313
"""Fetch the stars when app is built as default"""
14-
data = httpx.get(GITHUB_API_URL).json()
15-
return int(data["stargazers_count"])
14+
resp = httpx.get(GITHUB_API_URL)
15+
resp.raise_for_status()
16+
data = resp.json()
17+
return int(data.get("stargazers_count", 21000))
1618

1719

1820
REFLEX_STAR_COUNT = get_stars_on_build()

0 commit comments

Comments
 (0)