user.get_profile()->user.profile

This commit is contained in:
j 2016-02-19 22:04:15 +05:30
commit 1cc795995d
27 changed files with 72 additions and 70 deletions

View file

@ -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)

View file

@ -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)