Skip to content

Commit 22157f5

Browse files
committed
누락된 deprecated된 앱의 흔적 삭제
1 parent 1dc3285 commit 22157f5

File tree

3 files changed

+16
-98
lines changed

3 files changed

+16
-98
lines changed

accounts/urls.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
from django.urls import include, path
22

3-
from .views import GitHubLogin, GoogleLogin, MyPage, mypage_payments
4-
5-
from .views import IdLogin, Logout
6-
7-
from .views import login_api, logout_api
3+
from .views import GitHubLogin, GoogleLogin, IdLogin, Logout, login_api, logout_api
84

95
urlpatterns = [
106
path("auth/", include("dj_rest_auth.urls")),
@@ -14,13 +10,8 @@
1410
path("accounts/signup/", IdLogin.as_view(), name="account_signup"),
1511
path("auth/github/login/", GitHubLogin.as_view(), name="github_login"),
1612
path("auth/google/login/", GoogleLogin.as_view(), name="google_login"),
17-
#path("my-page/payments", MyPage.as_view())
18-
path("my-page/payments/", mypage_payments),
1913

2014
# Endpoints for Seesion Based Login
2115
path("api/login/", login_api, name="login-api"),
2216
path("api/logout/", logout_api, name="logout-api"),
23-
# path("api/logout/", )
24-
25-
path("api/mypage/", MyPage.as_view(), name="mypage-api"),
2617
]

accounts/views.py

Lines changed: 4 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,14 @@
1+
from allauth.account.views import LoginView, LogoutView
12
from allauth.socialaccount.providers.github.views import GitHubOAuth2Adapter
23
from allauth.socialaccount.providers.google.views import GoogleOAuth2Adapter
34
from allauth.socialaccount.providers.oauth2.client import OAuth2Client
45
from dj_rest_auth.registration.views import SocialLoginView
5-
66
from django.conf import settings
7-
from django.contrib.auth.decorators import login_required
8-
from django.shortcuts import render
9-
from django.contrib.auth import login, logout, authenticate
10-
from functional import seq
11-
12-
from rest_framework.response import Response
13-
from rest_framework.views import APIView
7+
from django.contrib.auth import authenticate, login, logout
148
from rest_framework.decorators import api_view
9+
from rest_framework.response import Response
1510

1611
from accounts.logics import get_basic_auth_token
17-
from accounts.view_models import UserTicketInfo
18-
from ticket.models import Ticket
19-
20-
from allauth.account.views import LoginView, LogoutView
2112

2213

2314
class IdLogin(LoginView):
@@ -41,37 +32,6 @@ class GoogleLogin(SocialLoginView):
4132
client_class = OAuth2Client
4233

4334

44-
class MyPage(APIView):
45-
def get(self, request):
46-
dto = {
47-
"ticket": self.get_ticket_info(request)
48-
# "session": None, # TODO 세션
49-
# "sponsor": None, # TODO 후원사
50-
# "user_info": None # TODO 사용자 정보
51-
}
52-
53-
return Response(dto)
54-
55-
def get_ticket_info(self, request) -> list:
56-
all_tickets = Ticket.objects.filter(
57-
user=request.user,
58-
is_refunded=False
59-
)
60-
61-
return list(
62-
seq(all_tickets)
63-
.map(UserTicketInfo)
64-
.map(lambda info: info.to_dict())
65-
)
66-
67-
68-
@login_required
69-
def mypage_payments(request):
70-
ticket_list = Ticket.objects.filter(user=request.user)
71-
return render(request, 'account_mypage_payments.html',
72-
context={'ticket_list': ticket_list})
73-
74-
7535
@api_view(["POST"])
7636
def login_api(request):
7737
if request.user.is_authenticated:
@@ -99,8 +59,4 @@ def logout_api(request):
9959
return Response({"msg": "not logged in"})
10060

10161
logout(request)
102-
103-
response_data = {
104-
"msg": "ok"
105-
}
106-
return Response(response_data)
62+
return Response({"msg": "ok"})

pyconkr/settings.py

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@
5454
"constance.backends.database",
5555
# apps
5656
"sponsor",
57-
"status",
58-
"ticket",
5957
"program",
60-
"payment",
6158
"accounts",
6259
"session",
6360
# swagger
@@ -142,18 +139,10 @@
142139
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
143140

144141
AUTH_PASSWORD_VALIDATORS = [
145-
{
146-
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
147-
},
148-
{
149-
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
150-
},
151-
{
152-
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
153-
},
154-
{
155-
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
156-
},
142+
{"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator"},
143+
{"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator"},
144+
{"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator"},
145+
{"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator"},
157146
]
158147

159148

@@ -186,30 +175,12 @@
186175
# django-constance
187176
CONSTANCE_BACKEND = "constance.backends.database.DatabaseBackend"
188177
CONSTANCE_CONFIG = {
189-
"SLACK_SECRET": (
190-
"",
191-
"Slack 알림 전송에 사용할 Secret",
192-
),
193-
"SPONSOR_NOTI_CHANNEL": (
194-
"",
195-
"후원사 변동사항에 대한 알림을 보낼 채널",
196-
),
197-
"CONFERENCE_PARTICIPANT_COUNT_SAT": (
198-
1700,
199-
"컨퍼런스(토) 참가자 수",
200-
),
201-
"CONFERENCE_PARTICIPANT_COUNT_SUN": (
202-
1700,
203-
"컨퍼런스(일) 참가자 수",
204-
),
205-
"IMP_KEY": (
206-
"",
207-
"포트원 REST API 키",
208-
),
209-
"IMP_SECRET": (
210-
"",
211-
"포트원 REST API 비밀키",
212-
),
178+
"SLACK_SECRET": ("", "Slack 알림 전송에 사용할 Secret"),
179+
"SPONSOR_NOTI_CHANNEL": ("", "후원사 변동사항에 대한 알림을 보낼 채널"),
180+
"CONFERENCE_PARTICIPANT_COUNT_SAT": (1700, "컨퍼런스(토) 참가자 수"),
181+
"CONFERENCE_PARTICIPANT_COUNT_SUN": (1700, "컨퍼런스(일) 참가자 수"),
182+
"IMP_KEY": ("", "포트원 REST API 키"),
183+
"IMP_SECRET": ("", "포트원 REST API 비밀키"),
213184
}
214185

215186
# drf-spectacular
@@ -265,6 +236,6 @@
265236

266237
# login_required view에 로그인 되지 않은 상태로 접속할 경우 리다이렉트할 로그인 페이지를 설정합니다.
267238
# The URL or named URL pattern where requests are redirected for login when using the login_required() decorator
268-
LOGIN_URL = '/accounts/login/'
239+
LOGIN_URL = "/accounts/login/"
269240

270241
AWS_QUERYSTRING_AUTH = False

0 commit comments

Comments
 (0)