|
10 | 10 | from django.urls import reverse, reverse_lazy |
11 | 11 | from django.utils.translation import gettext as _ |
12 | 12 | from django.views.generic import FormView, TemplateView |
13 | | -from ninja import Schema |
14 | 13 | from ninja_extra.shortcuts import get_object_or_none |
15 | | -from pydantic import HttpUrl |
16 | 14 |
|
17 | 15 | from api.forms import ThirdPartyAuthForm |
18 | 16 | from api.models import ApiClient |
| 17 | +from api.schemas import ThirdPartyAuthParamsSchema |
19 | 18 | from core.models import SithFile |
20 | 19 | from core.schemas import UserProfileSchema |
21 | 20 | from core.utils import hmac_hexdigest |
22 | 21 |
|
23 | 22 |
|
24 | | -class ThirdPartyAuthParamsSchema(Schema): |
25 | | - client_id: int |
26 | | - third_party_app: str |
27 | | - cgu_link: HttpUrl |
28 | | - username: str |
29 | | - callback_url: HttpUrl |
30 | | - signature: str |
31 | | - |
32 | | - |
33 | 23 | class ThirdPartyAuthView(LoginRequiredMixin, FormView): |
34 | 24 | form_class = ThirdPartyAuthForm |
35 | 25 | template_name = "api/third_party/auth.jinja" |
@@ -93,7 +83,7 @@ def form_valid(self, form): |
93 | 83 | def get_context_data(self, **kwargs): |
94 | 84 | return super().get_context_data(**kwargs) | { |
95 | 85 | "third_party_app": self.params.third_party_app, |
96 | | - "third_party_cgu": self.params.cgu_link, |
| 86 | + "third_party_cgu": self.params.privacy_link, |
97 | 87 | "sith_cgu": SithFile.objects.get(id=settings.SITH_CGU_FILE_ID), |
98 | 88 | } |
99 | 89 |
|
|
0 commit comments