Merge branch 'hotfix/lil-606' into 'master'

lil-606

See merge request lilcity/backend!114
remotes/origin/hotfix/LIL-661
cfwme 7 years ago
commit f2d1f4fd18
  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,
@ -103,7 +103,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