Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #272 from match4healthcare/fix-pagination-hospitals
Browse files Browse the repository at this point in the history
Fix pagination error of hospitals on staff page
  • Loading branch information
kevihiiin authored Mar 29, 2020
2 parents 98b81bf + 8faea70 commit fa1c390
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions backend/apps/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from django.contrib.auth import login, logout
from django.shortcuts import redirect
from django.views.generic import CreateView

from django_tables2 import MultiTableMixin
from django.views.generic.base import TemplateView

from django.conf import settings
from .forms import StudentSignUpForm, HospitalSignUpForm
Expand Down Expand Up @@ -195,9 +196,13 @@ def edit_hospital_profile(request):
@staff_member_required
def approve_hospitals(request):
table_approved = ApprovalHospitalTable(Hospital.objects.filter(is_approved=True))
table_approved.paginate(page=request.GET.get("page", 1), per_page=5)
table_approved.prefix = 'approved'
table_approved.paginate(page=request.GET.get(table_approved.prefix + "page", 1), per_page=5)

table_unapproved = ApprovalHospitalTable(Hospital.objects.filter(is_approved=False))
table_unapproved.paginate(page=request.GET.get("page", 1), per_page=5)
table_unapproved.prefix = 'unapproved'
table_unapproved.paginate(page=request.GET.get(table_unapproved.prefix + "page", 1), per_page=5)

return render(request, 'approve_hospitals.html', {'table_approved': table_approved, 'table_unapproved': table_unapproved})

@login_required
Expand Down

0 comments on commit fa1c390

Please sign in to comment.