Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 简化版本获取方式 #1357

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6.22
9 changes: 2 additions & 7 deletions itsm/sites/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@

import os
import datetime
import re

from blueapps.account.decorators import login_exempt
from django.conf import settings
Expand Down Expand Up @@ -167,14 +166,10 @@ def get_version():
@summary: 获取版本信息
"""
# 读取文件内容
app_desc = os.path.join(settings.PROJECT_ROOT, "app_desc.yaml")
app_desc = os.path.join(settings.PROJECT_ROOT, "VERSION")
with open(app_desc, 'r') as file:
content = file.read()

# 使用正则表达式提取版本号
pattern = r'app_version:\s*"([\d.]+)"'
match = re.search(pattern, content)
return match[1] if match else "2.6"
return content.strip()


template_name = "wiki/create.html"
Loading