Compare commits
2 commits
032b843bac
...
7ba58d0b63
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ba58d0b63 | |||
| b18a6ab3ca |
3 changed files with 12 additions and 10 deletions
|
|
@ -29,18 +29,14 @@ RUN_RELOADER = True
|
||||||
NOTIFIER = None
|
NOTIFIER = None
|
||||||
|
|
||||||
def get_version():
|
def get_version():
|
||||||
info = join(dirname(dirname(dirname(__file__))), '.bzr', 'branch', 'last-revision')
|
|
||||||
git_dir = join(dirname(dirname(dirname(__file__))), '.git')
|
git_dir = join(dirname(dirname(dirname(__file__))), '.git')
|
||||||
if exists(git_dir):
|
if exists(git_dir):
|
||||||
env = {'GIT_DIR': git_dir}
|
env = {'GIT_DIR': git_dir}
|
||||||
cmd = ['git', 'rev-list', 'HEAD', '--count']
|
cmd = ['git', 'rev-list', 'HEAD', '--count']
|
||||||
return subprocess.check_output(cmd, env=env).strip().decode('utf-8')
|
version = subprocess.check_output(cmd, env=env).strip().decode('utf-8')
|
||||||
elif exists(info):
|
if settings.VERSION_EPOCH:
|
||||||
f = open(info)
|
version = settings.VERSION_EPOCH + version
|
||||||
rev = int(f.read().split()[0])
|
return version
|
||||||
f.close()
|
|
||||||
if rev:
|
|
||||||
return u'%s' % rev
|
|
||||||
else:
|
else:
|
||||||
return u'unknown'
|
return u'unknown'
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -814,8 +814,12 @@ class Stream(models.Model):
|
||||||
|
|
||||||
# file could have been moved while encoding
|
# file could have been moved while encoding
|
||||||
# get current version from db and update
|
# get current version from db and update
|
||||||
self.refresh_from_db()
|
try:
|
||||||
self.update_status(ok, error)
|
self.refresh_from_db()
|
||||||
|
except archive.models.DoesNotExist:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
self.update_status(ok, error)
|
||||||
|
|
||||||
def get_index(self):
|
def get_index(self):
|
||||||
index = 1
|
index = 1
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,8 @@ LANGUAGE_CODE = 'en-us'
|
||||||
|
|
||||||
SITE_ID = 1
|
SITE_ID = 1
|
||||||
|
|
||||||
|
VERSION_EPOCH = None
|
||||||
|
|
||||||
# If you set this to False, Django will make some optimizations so as not
|
# If you set this to False, Django will make some optimizations so as not
|
||||||
# to load the internationalization machinery.
|
# to load the internationalization machinery.
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue