From 2c3ff91c912a8a5c7e3d222092e4743ec3a79f52 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 5 Mar 2014 20:29:01 +0000 Subject: [PATCH] allow uploading videos to canAddItems --- pandora/archive/models.py | 1 + pandora/archive/views.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 430b5cb5..d8521e2e 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -286,6 +286,7 @@ class File(models.Model): def editable(self, user): p = user.get_profile() return p.get_level() in ('admin', 'staff') or \ + (not self.available and p.capability('canAddItems')) or \ self.instances.filter(volume__user=user).count() > 0 or \ (not self.item or self.item.user == user) diff --git a/pandora/archive/views.py b/pandora/archive/views.py index 108934c0..a1d6278b 100644 --- a/pandora/archive/views.py +++ b/pandora/archive/views.py @@ -181,7 +181,7 @@ def addMedia(request): data = json.loads(request.POST['data']) oshash = data.pop('id') if not request.user.get_profile().capability('canAddItems'): - response = json_response(status=403, text='permissino denied') + response = json_response(status=403, text='permission denied') elif models.File.objects.filter(oshash=oshash).count() > 0: f = models.File.objects.get(oshash=oshash) if f.available: