user.get_profile()->user.profile
This commit is contained in:
parent
3e8f28ff47
commit
1cc795995d
27 changed files with 72 additions and 70 deletions
|
|
@ -114,7 +114,7 @@ class NewsManager(Manager):
|
|||
if conditions:
|
||||
qs = qs.filter(conditions)
|
||||
if user:
|
||||
if not user.get_profile().get_level() in ('staff', 'admin'):
|
||||
if not user.profile.get_level() in ('staff', 'admin'):
|
||||
qs = qs.filter(Q(public=True)|Q(user=user))
|
||||
else:
|
||||
qs = qs.filter(public=True)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class News(models.Model):
|
|||
text = models.TextField()
|
||||
|
||||
def editable(self, user):
|
||||
return user.is_authenticated() and user.get_profile().capability("canEditSitePages")
|
||||
return user.is_authenticated() and user.profile.capability("canEditSitePages")
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
super(News, self).save(*args, **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue