|
|
@ -1094,14 +1094,11 @@ def get_update_status():
|
|
|
|
tz = datetime.timedelta(seconds=time.timezone if (time.localtime().tm_isdst == 0) else time.altzone)
|
|
|
|
tz = datetime.timedelta(seconds=time.timezone if (time.localtime().tm_isdst == 0) else time.altzone)
|
|
|
|
|
|
|
|
|
|
|
|
if request.method == "GET":
|
|
|
|
if request.method == "GET":
|
|
|
|
# get current commit hash from file
|
|
|
|
version = helper.get_current_version_info()
|
|
|
|
try:
|
|
|
|
if version is False:
|
|
|
|
with open('version', 'r') as f:
|
|
|
|
status['current_commit_hash'] = _(u'Unknown')
|
|
|
|
data = f.read().replace('\n', '')
|
|
|
|
else:
|
|
|
|
if helper.is_sha1(data):
|
|
|
|
status['current_commit_hash'] = version['sha']
|
|
|
|
status['current_commit_hash'] = data
|
|
|
|
|
|
|
|
except FileNotFoundError:
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
r = requests.get(repository_url + '/git/refs/heads/master')
|
|
|
|
r = requests.get(repository_url + '/git/refs/heads/master')
|
|
|
@ -2749,10 +2746,12 @@ def profile():
|
|
|
|
@login_required
|
|
|
|
@login_required
|
|
|
|
@admin_required
|
|
|
|
@admin_required
|
|
|
|
def admin():
|
|
|
|
def admin():
|
|
|
|
commit = '$Format:%cI$'
|
|
|
|
version = helper.get_current_version_info()
|
|
|
|
if commit.startswith("$"):
|
|
|
|
if version is False:
|
|
|
|
commit = _(u'Unknown')
|
|
|
|
commit = _(u'Unknown')
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
|
|
|
|
commit = version['datetime']
|
|
|
|
|
|
|
|
|
|
|
|
tz = datetime.timedelta(seconds=time.timezone if (time.localtime().tm_isdst == 0) else time.altzone)
|
|
|
|
tz = datetime.timedelta(seconds=time.timezone if (time.localtime().tm_isdst == 0) else time.altzone)
|
|
|
|
form_date = datetime.datetime.strptime(commit[:19], "%Y-%m-%dT%H:%M:%S")
|
|
|
|
form_date = datetime.datetime.strptime(commit[:19], "%Y-%m-%dT%H:%M:%S")
|
|
|
|
if len(commit) > 19: # check if string has timezone
|
|
|
|
if len(commit) > 19: # check if string has timezone
|
|
|
|