diff --git a/pandora/item/models.py b/pandora/item/models.py index 6133a9763..5bc60557b 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1041,6 +1041,10 @@ class Item(models.Model): if streams.count() > 1: timelines = [s.timeline_prefix for s in self.streams()] join_timelines(timelines, self.timeline_prefix) + else: + #remove joined timeline if it was created at some point + for f in glob(os.path.join(settings.MEDIA_ROOT, self.path(), 'timeline*.png')): + os.unlink(f) def make_poster(self, force=False): ox.makedirs(os.path.join(settings.MEDIA_ROOT,self.path())) diff --git a/pandora/itemlist/models.py b/pandora/itemlist/models.py index 837efce0f..3c8d950e1 100644 --- a/pandora/itemlist/models.py +++ b/pandora/itemlist/models.py @@ -91,8 +91,11 @@ class List(models.Model): return self.user == user or self.status in ('public', 'featured') def editable(self, user): - #FIXME: make permissions work - if self.user == user or user.is_staff: + if user.is_anonymous(): + return False + if self.user == user or \ + user.is_staff or \ + user.get_profile().capability('canEditFeaturedLists') == True: return True return False