From d6c17eba5b89a0f7821893aaa8e9d93615acb91d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 8 Aug 2011 17:59:11 +0200 Subject: [PATCH] languages --- pandora/item/models.py | 2 +- pandora/item/tasks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index e32d1882..fd7d243e 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -410,7 +410,7 @@ class Item(models.Model): ll = layers.setdefault(l.name, []) qs = Annotation.objects.filter(layer=l, item=self) if l.private: - if user.is_anonymous(): + if user and user.is_anonymous(): user = None qs = qs.filter(user=user) for a in qs.order_by('start'): diff --git a/pandora/item/tasks.py b/pandora/item/tasks.py index 5511b561..bb77b03a 100644 --- a/pandora/item/tasks.py +++ b/pandora/item/tasks.py @@ -45,7 +45,7 @@ def load_subtitles(itemId): languages = [f.language for f in item.files.filter(is_main=True, is_subtitle=True, available=True)] if languages: - if 'en' in languages: + if 'en' in languages or '' in languages: language = 'en' else: language = languages[0]