forked from 0x2620/pandora
same films for all
This commit is contained in:
parent
6c5b74d57c
commit
5e1a2234ee
1 changed files with 4 additions and 2 deletions
|
@ -6,6 +6,7 @@ from random import randint
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.db.models import Max
|
from django.db.models import Max
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
from item.models import Item
|
from item.models import Item
|
||||||
|
|
||||||
|
@ -22,10 +23,11 @@ class Channel(models.Model):
|
||||||
|
|
||||||
def json(self, user):
|
def json(self, user):
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
|
cansee = settings.CONFIG['capabilities']['canSeeItem']['guest']
|
||||||
if self.list:
|
if self.list:
|
||||||
items = self.list.get_items().filter(rendered=True)
|
items = self.list.get_items(self.list.user).filter(rendered=True, level__lte=cansee)
|
||||||
else:
|
else:
|
||||||
items = Item.objects.filter(rendered=True)
|
items = Item.objects.filter(rendered=True, level__lte=cansee)
|
||||||
if items.count() == 0:
|
if items.count() == 0:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue