Skip to content
Permalink
Browse files

bug fix: update version number

  • Loading branch information
usmannasir committed Jan 6, 2020
1 parent 153d143 commit 75f4a97de6c6d00a26881622826eb482dc886be3
Showing with 16 additions and 3 deletions.
  1. +16 −3 baseTemplate/views.py
@@ -110,7 +110,7 @@ def versionManagment(request):
else:
return ACLManager.loadError()

vers = version.objects.get(pk=1)
## Get latest version

getVersion = requests.get('https://raw.githubusercontent.com/usmannasir/cyberpanel/stable/version.txt')

@@ -119,8 +119,21 @@ def versionManagment(request):
latestVersion = latest['version']
latestBuild = latest['build']

return render(request, 'baseTemplate/versionManagment.html', {'build': vers.build,
'currentVersion': vers.currentVersion,
## Get local version


versionFile = '/usr/local/CyberCP/version.txt'

try:
data = open(versionFile, 'r').read().split('\n')
currentVersion = data[0]
currentBuild = data[1]
except:
currentVersion = latestVersion
currentBuild = latestBuild + 'E'

return render(request, 'baseTemplate/versionManagment.html', {'build': currentBuild,
'currentVersion': currentVersion,
'latestVersion': latestVersion,
'latestBuild': latestBuild})

0 comments on commit 75f4a97

Please sign in to comment.
You can’t perform that action at this time.