def threads(self, request, pk=None): profile = self.get_user(request, pk) page = get_int_or_404(request.query_params.get('page', 0)) if page == 1: page = 0 # api allows explicit first page feed = UserThreads(request, profile, page) return Response(feed.get_frontend_context())
def threads(request, profile): context = { 'profile': profile } feed = UserThreads(request, profile) context.update(feed.get_template_context()) request.frontend_context['POSTS'] = feed.get_frontend_context() return render(request, 'misago/profile/threads.html', context)
def get_context_data(self, request, profile): feed = UserThreads(request, profile) request.frontend_context['POSTS'] = feed.get_frontend_context() return feed.get_template_context()