Compare commits

..

No commits in common. "0e20aa194c3a09bb29656424a280461186164fd7" and "ee4e2122ed81a66e2bd48fb09532ba5161cb87c6" have entirely different histories.

31 changed files with 13 additions and 18 deletions

View File

@ -23,7 +23,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure-kst@+h&50%!m$(d!l*qbb0l7f@z#@#me__yye^$5kg%0m%1=im' SECRET_KEY = 'django-insecure-kst@+h&50%!m$(d!l*qbb0l7f@z#@#me__yye^$5kg%0m%1=im'
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True DEBUG = False
ALLOWED_HOSTS = ['www.sillaamp.com', 'sillaamp.com', '192.168.1.119', 'localhost', '127.0.0.1', '*'] ALLOWED_HOSTS = ['www.sillaamp.com', 'sillaamp.com', '192.168.1.119', 'localhost', '127.0.0.1', '*']

View File

@ -15,11 +15,10 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
""" """
from django.contrib import admin from django.contrib import admin
from django.urls import path, include, re_path from django.urls import path, include
from django.views.generic import RedirectView from django.views.generic import RedirectView
from django.conf import settings from django.conf import settings
from django.conf.urls.static import static from django.conf.urls.static import static
from django.views.static import serve
urlpatterns = [ urlpatterns = [
@ -29,12 +28,10 @@ urlpatterns = [
path('accounts/', include('allauth.urls')), # allauth 기본 URL path('accounts/', include('allauth.urls')), # allauth 기본 URL
path('accounts/', include('C_accounts.urls')), # 커스텀 계정 URL path('accounts/', include('C_accounts.urls')), # 커스텀 계정 URL
path('', include('B_main.urls')), path('', include('B_main.urls')),
# 미디어 파일 서빙 (DEBUG=False 상황에서도 작동)
] ]
urlpatterns += [ # 미디어 파일 서빙 (개발 및 프로덕션 환경 모두)
re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}), urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
]
# 정적 파일 서빙 (개발 환경에서만) # 정적 파일 서빙 (개발 환경에서만)
if settings.DEBUG: if settings.DEBUG:

View File

@ -1,5 +1,7 @@
from django.urls import path from django.urls import path
from . import views from . import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [ urlpatterns = [
path('', views.main, name='main'), path('', views.main, name='main'),
@ -13,3 +15,6 @@ urlpatterns = [
path('signup/', views.signup_view, name='signup'), path('signup/', views.signup_view, name='signup'),
path('privacy-policy/', views.privacy_policy, name='privacy_policy'), path('privacy-policy/', views.privacy_policy, name='privacy_policy'),
] ]
# 미디어 파일 서빙 (개발 및 프로덕션 환경 모두)
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View File

@ -144,19 +144,12 @@ def search_people(request):
base_filter = Person.objects.all() base_filter = Person.objects.all()
# 현재 사용자의 권한에 따라 추가 필터 적용 # 현재 사용자의 권한에 따라 추가 필터 적용
print(f"[DEBUG] 검색 - 사용자: {request.user.username}, 슈퍼유저: {request.user.is_superuser}") if current_user_person and not current_user_person.모든사람보기권한:
print(f"[DEBUG] 검색 - current_user_person: {current_user_person}") # 모든사람보기권한이 False인 경우 회원가입한 사람만 표시 (user가 있는 사람들)
# 슈퍼유저이거나 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] 검색 - 모든 사람 표시 모드 (모든사람보기권한: {current_user_person.모든사람보기권한})") print(f"[DEBUG] 검색 - 모든 사람 표시 모드")
if query: if query:
# 이름, 소속, 직책, 키워드로 검색 # 이름, 소속, 직책, 키워드로 검색

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB