Skip to content

Commit

Permalink
Fixes #5097 (#5108)
Browse files Browse the repository at this point in the history
  • Loading branch information
thelostone-mc authored Sep 4, 2019
2 parents cc66832 + 49e66ae commit 00c8899
Showing 1 changed file with 24 additions and 7 deletions.
31 changes: 24 additions & 7 deletions app/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1996,16 +1996,33 @@ def profile(request, handle):
if page:
page = int(page)
activity_type = request.GET.get('a', '')
all_activities = profile.get_various_activities()
paginator = Paginator(profile_filter_activities(all_activities, activity_type, activity_tabs), 10)
if activity_type == 'currently_working':
currently_working_bounties = Bounty.objects.current().filter(interested__profile=profile).filter(interested__status='okay') \
.filter(interested__pending=False).filter(idx_status__in=Bounty.WORK_IN_PROGRESS_STATUSES)
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)]

return TemplateResponse(request, 'profiles/profile_bounties.html', context, status=status)

else:

all_activities = profile.get_various_activities()
paginator = Paginator(profile_filter_activities(all_activities, activity_type, activity_tabs), 10)

if page > paginator.num_pages:
return HttpResponse(status=204)
if page > paginator.num_pages:
return HttpResponse(status=204)

context = {}
context['activities'] = [ele.view_props for ele in paginator.get_page(page)]
context = {}
context['activities'] = [ele.view_props for ele in paginator.get_page(page)]

return TemplateResponse(request, 'profiles/profile_activities.html', context, status=status)
return TemplateResponse(request, 'profiles/profile_activities.html', context, status=status)


context = profile.to_dict(tips=False)
Expand Down

0 comments on commit 00c8899

Please sign in to comment.