Compare commits

..

2 Commits

31 changed files with 18 additions and 13 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'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
DEBUG = True
ALLOWED_HOSTS = ['www.sillaamp.com', 'sillaamp.com', '192.168.1.119', 'localhost', '127.0.0.1', '*']

View File

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

View File

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

View File

@ -144,12 +144,19 @@ def search_people(request):
base_filter = Person.objects.all()
# 현재 사용자의 권한에 따라 추가 필터 적용
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.모든사람보기권한})")
if query:
# 이름, 소속, 직책, 키워드로 검색

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB