Reworked the about page for a nicer version of the git hash (#283)

The git hash looks currently like this:

`Build from GiT Revision: ('d3189f78c47d812f447739f97876ced01227e1fd',)`

After this change it should look like this:
`Build from GiT Revision: d3189f78c47d812f447739f97876ced01227e1fd`
This commit is contained in:
Philipp Horstenkamp 2023-10-29 12:56:08 +01:00 committed by GitHub
parent fca53c5e0c
commit 6526549bdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,6 +25,11 @@ def layout() -> list[html]:
Returns:
A list of html element making up this page.
"""
git_revision = os.getenv("GIT_HASH", "Running locally")
for _ in "',()":
git_revision = git_revision.replace(_, "")
git_revision = git_revision.strip()
return [
header_elements.create_selection_header("About"),
html.H3("About Us"),
@ -40,9 +45,7 @@ def layout() -> list[html]:
html.Ul(
[
html.Li(f"Software Version: {__version__}"),
html.Li(
f"Build from GiT Revision: {os.getenv('GIT_HASH', 'Running locally'), }"
),
html.Li(f"Build from GiT Revision: {git_revision}"),
]
),
]