From ead22ed2228794262ef9c71a2b9c92c5492b7479 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 16 Nov 2012 02:27:09 +0100 Subject: [PATCH] fix sort check --- README | 4 +++- pandora/item/models.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README b/README index 92dbd7b0..23c47af5 100644 --- a/README +++ b/README @@ -146,7 +146,9 @@ Now you can open pandora in your browser, the first user to sign up will become === Updating === To update a pandora installation get the latest version from bzr by running - ./update.py + su pandora + cd /srv/pandora + ./update.py this will update pandora/oxjs/python-ox and list possible upgrades to the db diff --git a/pandora/item/models.py b/pandora/item/models.py index 66b2fc92..a471f1eb 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -361,10 +361,14 @@ class Item(models.Model): else: self.poster_height = 128 self.poster_width = 80 - if not settings.USE_IMDB and self.sort: - if self.poster_frame == -1 and self.sort.duration: - self.poster_frame = self.sort.duration/2 - update_poster = True + if not settings.USE_IMDB: + if self.poster_frame == -1: + try: + if self.sort.duration: + self.poster_frame = self.sort.duration/2 + update_poster = True + except ItemSort.DoesNotExist: + pass self.json = self.get_json() self.json['modified'] = datetime.now() super(Item, self).save(*args, **kwargs)