From e77016ea9b29574718b4d97e01e7af33246aace5 Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 27 Jul 2023 18:49:39 +0200 Subject: [PATCH] playing around --- cookbook/templates/system.html | 2 ++ cookbook/views/views.py | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cookbook/templates/system.html b/cookbook/templates/system.html index 60bb886d..d8e06b94 100644 --- a/cookbook/templates/system.html +++ b/cookbook/templates/system.html @@ -30,6 +30,8 @@ {{ version }}{% else %} {{ version }}{% endif %}
Ref: {{ ref }} + +
{{ version_info }}



diff --git a/cookbook/views/views.py b/cookbook/views/views.py index 834ffb86..00e1a331 100644 --- a/cookbook/views/views.py +++ b/cookbook/views/views.py @@ -1,5 +1,6 @@ import os import re +import subprocess from datetime import datetime from uuid import UUID @@ -22,7 +23,7 @@ from cookbook.helper.permission_helper import group_required, has_group_permissi from cookbook.models import (Comment, CookLog, InviteLink, SearchFields, SearchPreference, ShareLink, Space, ViewLog, UserSpace) from cookbook.tables import (CookLogTable, ViewLogTable) -from recipes.settings import PLUGINS +from recipes.settings import PLUGINS, BASE_DIR from recipes.version import BUILD_REF, VERSION_NUMBER @@ -317,11 +318,16 @@ def system(request): secret_key = False if os.getenv('SECRET_KEY') else True + r = subprocess.check_output(['git', 'show', '-s'], cwd=BASE_DIR) + r = subprocess.check_output(['git', 'show', '-s'], cwd=os.path.join(BASE_DIR, 'recipes', 'plugins', 'enterprise_plugin')) + version_info = r.decode() + return render(request, 'system.html', { 'gunicorn_media': settings.GUNICORN_MEDIA, 'debug': settings.DEBUG, 'postgres': postgres, 'version': VERSION_NUMBER, + 'version_info': version_info, 'ref': BUILD_REF, 'plugins': PLUGINS, 'secret_key': secret_key