|
10 | 10 | import json |
11 | 11 | import logging |
12 | 12 | import os.path |
13 | | -from urllib.parse import urlparse |
14 | 13 |
|
15 | 14 | import requests |
16 | 15 | from django.contrib import messages |
|
47 | 46 | from fedcode.activitypub import AP_CONTEXT |
48 | 47 | from fedcode.activitypub import create_activity_obj |
49 | 48 | from fedcode.activitypub import has_valid_header |
| 49 | +from fedcode.forms import AdminLoginForm |
50 | 50 | from fedcode.forms import CreateGitRepoForm |
51 | 51 | from fedcode.forms import CreateNoteForm |
52 | 52 | from fedcode.forms import CreateReviewForm |
|
57 | 57 | from fedcode.forms import SearchRepositoryForm |
58 | 58 | from fedcode.forms import SearchReviewForm |
59 | 59 | from fedcode.forms import SubscribePackageForm |
| 60 | +from fedcode.forms import UserLoginForm |
60 | 61 | from fedcode.models import Follow |
61 | 62 | from fedcode.models import Note |
62 | 63 | from fedcode.models import Package |
@@ -277,6 +278,7 @@ def post(self, request, repository_id): |
277 | 278 | class UserLogin(LoginView): |
278 | 279 | template_name = "login.html" |
279 | 280 | next_page = "/" |
| 281 | + form_class = UserLoginForm |
280 | 282 |
|
281 | 283 | def dispatch(self, request, *args, **kwargs): |
282 | 284 | # If user is already logged in, redirect to the next_page. |
@@ -887,3 +889,8 @@ def revoke_token(request): |
887 | 889 | }, |
888 | 890 | ) |
889 | 891 | return JsonResponse(json.loads(r.content), status=r.status_code, content_type=AP_CONTENT_TYPE) |
| 892 | + |
| 893 | + |
| 894 | +class AdminLoginView(LoginView): |
| 895 | + template_name = "admin_login.html" |
| 896 | + authentication_form = AdminLoginForm |
0 commit comments