remotes/origin/hotfix/LIL-661
gzbender 8 years ago
parent bd26578ecb
commit 981ef7416b
  1. 4
      apps/user/views.py

@ -55,11 +55,11 @@ class ProfileView(TemplateView):
def get_context_data(self, object):
context = super().get_context_data()
context['user'] = self.request.user
context['is_author'] = self.request.user.role == User.AUTHOR_ROLE
context['published'] = Course.objects.filter(
author=self.object,
)
context['is_author'] = context['published'] or self.request.user.role == User.AUTHOR_ROLE
context['paid'] = Course.objects.filter(
payments__in=CoursePayment.objects.filter(
user=self.object,
@ -113,7 +113,7 @@ class UserView(DetailView):
def get_context_data(self, object):
context = super().get_context_data()
context['published'] = Course.objects.filter(
author=self.object,
author=self.object, status=Course.PUBLISHED,
)
return context

Loading…
Cancel
Save