Add the git commit hash details to the About dialog. #7623

This commit is contained in:
Aditya Toshniwal
2024-06-27 13:20:00 +05:30
committed by GitHub
parent 3be2221948
commit 6f96f67655
7 changed files with 42 additions and 29 deletions
+10
View File
@@ -103,6 +103,16 @@ if not os.path.isfile(config.SQLITE_PATH):
app = create_app()
app.config['sessions'] = dict()
# We load the file here instead of evaluate config
# as we don't know the path of this file in evaluate config
# commit_hash file resides in the web directory
try:
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)),
'commit_hash')) as f:
config.COMMIT_HASH = f.readline().strip()
except FileNotFoundError as _:
config.COMMIT_HASH = None
if setup_db_required:
setup.setup_db(app)