user can be none
This commit is contained in:
parent
046c49cd3b
commit
2a0c2acc97
2 changed files with 2 additions and 2 deletions
|
@ -122,7 +122,7 @@ class Collection(models.Model):
|
||||||
return self.user == user or self.status in ('public', 'featured')
|
return self.user == user or self.status in ('public', 'featured')
|
||||||
|
|
||||||
def editable(self, user):
|
def editable(self, user):
|
||||||
if user.is_anonymous():
|
if not user or user.is_anonymous():
|
||||||
return False
|
return False
|
||||||
if self.user == user or \
|
if self.user == user or \
|
||||||
self.groups.filter(id__in=user.groups.all()).count() > 0 or \
|
self.groups.filter(id__in=user.groups.all()).count() > 0 or \
|
||||||
|
|
|
@ -115,7 +115,7 @@ class List(models.Model):
|
||||||
return self.user == user or self.status in ('public', 'featured')
|
return self.user == user or self.status in ('public', 'featured')
|
||||||
|
|
||||||
def editable(self, user):
|
def editable(self, user):
|
||||||
if user.is_anonymous():
|
if not user or user.is_anonymous():
|
||||||
return False
|
return False
|
||||||
if self.user == user or \
|
if self.user == user or \
|
||||||
self.groups.filter(id__in=user.groups.all()).count() > 0 or \
|
self.groups.filter(id__in=user.groups.all()).count() > 0 or \
|
||||||
|
|
Loading…
Reference in a new issue