qhdtn6412 모든유저열람가능

This commit is contained in:
CPABONG 2025-08-03 12:49:28 +09:00
parent d44c4fe510
commit f0ce6090fb
39 changed files with 14 additions and 4 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -69,6 +69,7 @@ def check_authentication(request):
def main(request): def main(request):
print('def main(request):')
auth_check = check_authentication(request) auth_check = check_authentication(request)
if auth_check: if auth_check:
return auth_check return auth_check
@ -89,12 +90,19 @@ def main(request):
) )
# 현재 사용자의 권한에 따라 추가 필터 적용 # 현재 사용자의 권한에 따라 추가 필터 적용
if current_user_person and not current_user_person.모든사람보기권한: print(f"[DEBUG] 사용자: {request.user.username}, 슈퍼유저: {request.user.is_superuser}")
# 모든사람보기권한이 False인 경우 회원가입한 사람만 표시 (user가 있는 사람들) print(f"[DEBUG] current_user_person: {current_user_person}")
# 슈퍼유저이거나 Person 객체가 없는 경우 모든 사람 표시
if request.user.is_superuser or current_user_person is None:
print(f"[DEBUG] 슈퍼유저 또는 Person 객체 없음 - 모든 사람 표시 모드")
# 모든 사람 표시 (필터 추가 없음)
elif current_user_person and not current_user_person.모든사람보기권한:
# 모든사람보기권한이 False인 경우 회원가입한 사람만 표시
base_filter = base_filter.filter(user__isnull=False) base_filter = base_filter.filter(user__isnull=False)
print(f"[DEBUG] 회원가입자만 표시 모드: {current_user_person.이름}") print(f"[DEBUG] 회원가입자만 표시 모드: {current_user_person.이름}")
else: else:
print(f"[DEBUG] 모든 사람 표시 모드") print(f"[DEBUG] 모든 사람 표시 모드 (모든사람보기권한: {current_user_person.모든사람보기권한})")
# 순서가 있는 항목을 먼저 보여주고, 나머지는 가나다순으로 정렬 # 순서가 있는 항목을 먼저 보여주고, 나머지는 가나다순으로 정렬
people = base_filter.annotate( people = base_filter.annotate(
@ -106,9 +114,11 @@ def main(request):
).order_by('sequence_order', 'SEQUENCE', '이름') ).order_by('sequence_order', 'SEQUENCE', '이름')
print(f"[DEBUG] 메인 페이지 표시: {people.count()}") print(f"[DEBUG] 메인 페이지 표시: {people.count()}")
print(f"[DEBUG] === 표시되는 사람들 ===")
for person in people: for person in people:
status = "회원가입" if person.user else "미가입" status = "회원가입" if person.user else "미가입"
print(f"[DEBUG] - {person.이름} (상태: {status})") print(f"[DEBUG] - {person.이름} (상태: {status}, 소속: {person.소속})")
print(f"[DEBUG] === 표시 끝 ===")
return render(request, 'B_main/main.htm', {'people': people}) return render(request, 'B_main/main.htm', {'people': people})

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.