languages

This commit is contained in:
j 2011-08-08 17:59:11 +02:00
parent 1523a81007
commit d6c17eba5b
2 changed files with 2 additions and 2 deletions

View file

@ -410,7 +410,7 @@ class Item(models.Model):
ll = layers.setdefault(l.name, []) ll = layers.setdefault(l.name, [])
qs = Annotation.objects.filter(layer=l, item=self) qs = Annotation.objects.filter(layer=l, item=self)
if l.private: if l.private:
if user.is_anonymous(): if user and user.is_anonymous():
user = None user = None
qs = qs.filter(user=user) qs = qs.filter(user=user)
for a in qs.order_by('start'): for a in qs.order_by('start'):

View file

@ -45,7 +45,7 @@ def load_subtitles(itemId):
languages = [f.language for f in item.files.filter(is_main=True, is_subtitle=True, languages = [f.language for f in item.files.filter(is_main=True, is_subtitle=True,
available=True)] available=True)]
if languages: if languages:
if 'en' in languages: if 'en' in languages or '' in languages:
language = 'en' language = 'en'
else: else:
language = languages[0] language = languages[0]