qhdtn6412 모든유저열람가능
This commit is contained in:
parent
d44c4fe510
commit
f0ce6090fb
BIN
A_core/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
A_core/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
BIN
A_core/__pycache__/settings.cpython-313.pyc
Normal file
BIN
A_core/__pycache__/settings.cpython-313.pyc
Normal file
Binary file not shown.
BIN
A_core/__pycache__/urls.cpython-313.pyc
Normal file
BIN
A_core/__pycache__/urls.cpython-313.pyc
Normal file
Binary file not shown.
BIN
A_core/__pycache__/wsgi.cpython-313.pyc
Normal file
BIN
A_core/__pycache__/wsgi.cpython-313.pyc
Normal file
Binary file not shown.
BIN
B_main/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
B_main/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
BIN
B_main/__pycache__/admin.cpython-313.pyc
Normal file
BIN
B_main/__pycache__/admin.cpython-313.pyc
Normal file
Binary file not shown.
BIN
B_main/__pycache__/apps.cpython-313.pyc
Normal file
BIN
B_main/__pycache__/apps.cpython-313.pyc
Normal file
Binary file not shown.
BIN
B_main/__pycache__/forms.cpython-313.pyc
Normal file
BIN
B_main/__pycache__/forms.cpython-313.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
B_main/__pycache__/models.cpython-313.pyc
Normal file
BIN
B_main/__pycache__/models.cpython-313.pyc
Normal file
Binary file not shown.
BIN
B_main/__pycache__/peopleinfo.cpython-313.pyc
Normal file
BIN
B_main/__pycache__/peopleinfo.cpython-313.pyc
Normal file
Binary file not shown.
BIN
B_main/__pycache__/urls.cpython-313.pyc
Normal file
BIN
B_main/__pycache__/urls.cpython-313.pyc
Normal file
Binary file not shown.
BIN
B_main/__pycache__/views.cpython-313.pyc
Normal file
BIN
B_main/__pycache__/views.cpython-313.pyc
Normal file
Binary file not shown.
Binary file not shown.
BIN
B_main/migrations/__pycache__/0001_initial.cpython-313.pyc
Normal file
BIN
B_main/migrations/__pycache__/0001_initial.cpython-313.pyc
Normal file
Binary file not shown.
BIN
B_main/migrations/__pycache__/0002_person_user.cpython-313.pyc
Normal file
BIN
B_main/migrations/__pycache__/0002_person_user.cpython-313.pyc
Normal file
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.
BIN
B_main/migrations/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
B_main/migrations/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
@ -69,6 +69,7 @@ def check_authentication(request):
|
||||
|
||||
|
||||
def main(request):
|
||||
print('def main(request):')
|
||||
auth_check = check_authentication(request)
|
||||
if auth_check:
|
||||
return auth_check
|
||||
@ -89,12 +90,19 @@ def main(request):
|
||||
)
|
||||
|
||||
# 현재 사용자의 권한에 따라 추가 필터 적용
|
||||
if current_user_person and not current_user_person.모든사람보기권한:
|
||||
# 모든사람보기권한이 False인 경우 회원가입한 사람만 표시 (user가 있는 사람들)
|
||||
print(f"[DEBUG] 사용자: {request.user.username}, 슈퍼유저: {request.user.is_superuser}")
|
||||
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)
|
||||
print(f"[DEBUG] 회원가입자만 표시 모드: {current_user_person.이름}")
|
||||
else:
|
||||
print(f"[DEBUG] 모든 사람 표시 모드")
|
||||
print(f"[DEBUG] 모든 사람 표시 모드 (모든사람보기권한: {current_user_person.모든사람보기권한})")
|
||||
|
||||
# 순서가 있는 항목을 먼저 보여주고, 나머지는 가나다순으로 정렬
|
||||
people = base_filter.annotate(
|
||||
@ -106,9 +114,11 @@ def main(request):
|
||||
).order_by('sequence_order', 'SEQUENCE', '이름')
|
||||
|
||||
print(f"[DEBUG] 메인 페이지 표시: {people.count()}명")
|
||||
print(f"[DEBUG] === 표시되는 사람들 ===")
|
||||
for person in people:
|
||||
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})
|
||||
|
||||
|
||||
BIN
C_accounts/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
C_accounts/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
BIN
C_accounts/__pycache__/admin.cpython-313.pyc
Normal file
BIN
C_accounts/__pycache__/admin.cpython-313.pyc
Normal file
Binary file not shown.
BIN
C_accounts/__pycache__/apps.cpython-313.pyc
Normal file
BIN
C_accounts/__pycache__/apps.cpython-313.pyc
Normal file
Binary file not shown.
BIN
C_accounts/__pycache__/forms.cpython-313.pyc
Normal file
BIN
C_accounts/__pycache__/forms.cpython-313.pyc
Normal file
Binary file not shown.
BIN
C_accounts/__pycache__/middleware.cpython-313.pyc
Normal file
BIN
C_accounts/__pycache__/middleware.cpython-313.pyc
Normal file
Binary file not shown.
BIN
C_accounts/__pycache__/models.cpython-313.pyc
Normal file
BIN
C_accounts/__pycache__/models.cpython-313.pyc
Normal file
Binary file not shown.
BIN
C_accounts/__pycache__/signals.cpython-313.pyc
Normal file
BIN
C_accounts/__pycache__/signals.cpython-313.pyc
Normal file
Binary file not shown.
BIN
C_accounts/__pycache__/urls.cpython-313.pyc
Normal file
BIN
C_accounts/__pycache__/urls.cpython-313.pyc
Normal file
Binary file not shown.
BIN
C_accounts/__pycache__/views.cpython-313.pyc
Normal file
BIN
C_accounts/__pycache__/views.cpython-313.pyc
Normal file
Binary file not shown.
BIN
C_accounts/migrations/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
C_accounts/migrations/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
BIN
C_accounts/templatetags/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
C_accounts/templatetags/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
BIN
C_accounts/templatetags/__pycache__/form_filters.cpython-313.pyc
Normal file
BIN
C_accounts/templatetags/__pycache__/form_filters.cpython-313.pyc
Normal file
Binary file not shown.
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user