def get_context_data(self, request, profile): ban = get_user_ban(profile) request.frontend_context['PROFILE_BAN'] = BanDetailsSerializer(ban).data return { 'ban': ban, }
def ban(self, request, pk=None): profile = self.get_user(request, pk) allow_see_ban_details(request.user, profile) ban = get_user_ban(profile) if ban: return Response(BanDetailsSerializer(ban).data) else: return Response({})
def user_ban(request, profile): ban = get_user_ban(profile) request.frontend_context['PROFILE_BAN'] = BanDetailsSerializer(ban).data return render(request, 'misago/profile/ban_details.html', { 'profile': profile, 'ban': ban, })