Compare commits

..

2 commits

Author SHA1 Message Date
j
7ba58d0b63 add way to change version 2020-05-15 18:48:58 +02:00
j
b18a6ab3ca stream might have been removed 2020-05-12 15:15:26 +02:00
3 changed files with 12 additions and 10 deletions

View file

@ -29,18 +29,14 @@ RUN_RELOADER = True
NOTIFIER = None
def get_version():
info = join(dirname(dirname(dirname(__file__))), '.bzr', 'branch', 'last-revision')
git_dir = join(dirname(dirname(dirname(__file__))), '.git')
if exists(git_dir):
env = {'GIT_DIR': git_dir}
cmd = ['git', 'rev-list', 'HEAD', '--count']
return subprocess.check_output(cmd, env=env).strip().decode('utf-8')
elif exists(info):
f = open(info)
rev = int(f.read().split()[0])
f.close()
if rev:
return u'%s' % rev
version = subprocess.check_output(cmd, env=env).strip().decode('utf-8')
if settings.VERSION_EPOCH:
version = settings.VERSION_EPOCH + version
return version
else:
return u'unknown'

View file

@ -814,7 +814,11 @@ class Stream(models.Model):
# file could have been moved while encoding
# get current version from db and update
try:
self.refresh_from_db()
except archive.models.DoesNotExist:
pass
else:
self.update_status(ok, error)
def get_index(self):

View file

@ -36,6 +36,8 @@ LANGUAGE_CODE = 'en-us'
SITE_ID = 1
VERSION_EPOCH = None
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True