diff --git a/pandora/archive/views.py b/pandora/archive/views.py index e5aae6124..0431da07c 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -257,9 +257,9 @@ def moveFiles(request): data['director'] = [] else: data['director'] = data['director'].split(', ') - i = get_item(data) + i = get_item(data, user=request.user) else: - i = get_item({'imdbId': data['itemId']}) + i = get_item({'imdbId': data['itemId']}, user=request.user) changed = [i.itemId] for f in models.File.objects.filter(oshash__in=data['ids']): if f.item.id != i.itemId and f.editable(request.user): diff --git a/pandora/item/models.py b/pandora/item/models.py index ef22e747f..6be495746 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -253,6 +253,8 @@ class Item(models.Model): update_poster = False update_ids = False if not self.id: + if self.user: + self.level = settings.CONFIG['rightsLevel'][self.user.get_profile().get_level()] if not self.itemId: self.itemId = str(uuid.uuid1()) super(Item, self).save(*args, **kwargs) @@ -943,7 +945,9 @@ class Item(models.Model): self.save() elif os.path.exists(poster): with open(poster) as f: - self.poster.save('poster.jpg', ContentFile(f.read())) + data = f.read() + if data: + self.poster.save('poster.jpg', ContentFile(data)) def make_siteposter(self): poster = self.path('siteposter.jpg')