Fix orphaned lines and undefined variables in physicians ui_views.py
This commit is contained in:
parent
3b9468748c
commit
ba63f8f1c6
@ -93,7 +93,6 @@ def physician_list(request):
|
||||
for physician in page_obj.object_list:
|
||||
physician.current_rating = ratings_dict.get(physician.id)
|
||||
|
||||
|
||||
departments = Department.objects.filter(status="active")
|
||||
if not user.is_px_admin() and user.hospital:
|
||||
departments = departments.filter(hospital=user.hospital)
|
||||
@ -117,7 +116,6 @@ def physician_list(request):
|
||||
"leaderboard": leaderboard,
|
||||
"year": year,
|
||||
"month": month,
|
||||
"hospitals": hospitals,
|
||||
"departments": departments,
|
||||
"filters": request.GET,
|
||||
"stats": stats,
|
||||
@ -146,8 +144,6 @@ def physician_ratings_dashboard(request):
|
||||
hospital_filter = request.GET.get("hospital")
|
||||
department_filter = request.GET.get("department")
|
||||
|
||||
departments = departments.filter(hospital=user.hospital)
|
||||
|
||||
# Get available years (2024 to current year)
|
||||
current_year = now.year
|
||||
years = list(range(2024, current_year + 1))
|
||||
@ -155,8 +151,6 @@ def physician_ratings_dashboard(request):
|
||||
|
||||
context = {
|
||||
"years": years,
|
||||
"hospitals": hospitals,
|
||||
"departments": departments,
|
||||
"filters": request.GET,
|
||||
}
|
||||
|
||||
@ -372,7 +366,6 @@ def ratings_list(request):
|
||||
page_number = request.GET.get("page", 1)
|
||||
page_obj = paginator.get_page(page_number)
|
||||
|
||||
|
||||
departments = Department.objects.filter(status="active")
|
||||
if not user.is_px_admin() and user.hospital:
|
||||
departments = departments.filter(hospital=user.hospital)
|
||||
@ -383,7 +376,6 @@ def ratings_list(request):
|
||||
context = {
|
||||
"page_obj": page_obj,
|
||||
"ratings": page_obj.object_list,
|
||||
"hospitals": hospitals,
|
||||
"departments": departments,
|
||||
"years": years,
|
||||
"filters": request.GET,
|
||||
@ -467,12 +459,10 @@ def specialization_overview(request):
|
||||
# Sort by average rating
|
||||
specializations.sort(key=lambda x: x["average_rating"], reverse=True)
|
||||
|
||||
|
||||
context = {
|
||||
"specializations": specializations,
|
||||
"year": year,
|
||||
"month": month,
|
||||
"hospitals": hospitals,
|
||||
"filters": request.GET,
|
||||
}
|
||||
|
||||
@ -558,12 +548,10 @@ def department_overview(request):
|
||||
# Sort by average rating
|
||||
departments.sort(key=lambda x: x["average_rating"], reverse=True)
|
||||
|
||||
|
||||
context = {
|
||||
"departments": departments,
|
||||
"year": year,
|
||||
"month": month,
|
||||
"hospitals": hospitals,
|
||||
"filters": request.GET,
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user