nothing to do with 0 files
This commit is contained in:
parent
6c12160174
commit
5a139094e9
1 changed files with 4 additions and 0 deletions
|
@ -163,6 +163,7 @@ class Item(models.Model):
|
||||||
return default
|
return default
|
||||||
|
|
||||||
def access(self, user):
|
def access(self, user):
|
||||||
|
#check rights level
|
||||||
if self.public:
|
if self.public:
|
||||||
return True
|
return True
|
||||||
elif user.is_authenticated() and \
|
elif user.is_authenticated() and \
|
||||||
|
@ -752,6 +753,9 @@ class Item(models.Model):
|
||||||
files = archive.models.File.objects.filter(item=self,
|
files = archive.models.File.objects.filter(item=self,
|
||||||
streams__available=True,
|
streams__available=True,
|
||||||
streams__source=None)
|
streams__source=None)
|
||||||
|
if files.count() == 0:
|
||||||
|
return
|
||||||
|
|
||||||
def get_level(users):
|
def get_level(users):
|
||||||
if users.filter(is_superuser=True).count() > 0: level = 0
|
if users.filter(is_superuser=True).count() > 0: level = 0
|
||||||
elif users.filter(is_staff=True).count() > 0: level = 1
|
elif users.filter(is_staff=True).count() > 0: level = 1
|
||||||
|
|
Loading…
Reference in a new issue