Skip to content

Commit f0ea6f5

Browse files
authored
Merge pull request #153 from pythonkr/feature/add-support-for-year
Deprecated된 App 제거 및 년도 컬럼 추가
2 parents d90d86b + 23b8433 commit f0ea6f5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+153
-1836
lines changed

accounts/templates/_base.html

Lines changed: 0 additions & 30 deletions
This file was deleted.

accounts/templates/account_mypage_payments.html

Lines changed: 0 additions & 29 deletions
This file was deleted.

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/view_models.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

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"})

payment/__init__.py

Whitespace-only changes.

payment/admin.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

payment/apps.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

payment/clients.py

Lines changed: 0 additions & 85 deletions
This file was deleted.

payment/enum.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)