From 2419934a1380939c0139545c984cb25442e1da5b Mon Sep 17 00:00:00 2001 From: octavioamu Date: Thu, 5 Sep 2019 11:55:20 -0300 Subject: [PATCH] exclude null or empty users --- app/dashboard/views.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/dashboard/views.py b/app/dashboard/views.py index 9cdf6fa57e6..d42b71df3b0 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -2003,15 +2003,15 @@ def profile(request, handle): currently_working_bounties_count = currently_working_bounties.count() if currently_working_bounties_count > 0: paginator = Paginator(currently_working_bounties, 10) - + if page > paginator.num_pages: return HttpResponse(status=204) context = {} - context['bounties'] = [bounty for bounty in paginator.get_page(page)] + context['bounties'] = [bounty for bounty in paginator.get_page(page)] return TemplateResponse(request, 'profiles/profile_bounties.html', context, status=status) - + else: all_activities = profile.get_various_activities() @@ -2601,7 +2601,9 @@ def get_suggested_contributors(request): Q(bounty__issue_description__icontains=keyword) recommended_developers = BountyFulfillment.objects.prefetch_related('bounty', 'profile') \ - .filter(keywords_filter).values('fulfiller_github_username', 'profile__id').distinct()[:10] + .filter(keywords_filter).values('fulfiller_github_username', 'profile__id') \ + .exclude(fulfiller_github_username__isnull=True) \ + .exclude(fulfiller_github_username__exact='').distinct()[:10] verified_developers = UserVerificationModel.objects.filter(verified=True).values('user__profile__handle', 'user__profile__id')