| 
1 | 1 | """Project views for authenticated users."""  | 
2 | 2 | 
 
  | 
3 | 3 | import structlog  | 
4 |  | -from allauth.socialaccount.models import SocialAccount  | 
5 | 4 | from django.conf import settings  | 
6 | 5 | from django.contrib import messages  | 
7 | 6 | from django.contrib.messages.views import SuccessMessageMixin  | 
 | 
15 | 14 | from django.shortcuts import get_object_or_404  | 
16 | 15 | from django.urls import reverse  | 
17 | 16 | from django.utils import timezone  | 
18 |  | -from django.utils.html import format_html  | 
19 | 17 | from django.utils.translation import gettext_lazy as _  | 
20 | 18 | from django.views.generic import ListView  | 
21 | 19 | from django.views.generic import TemplateView  | 
 | 
47 | 45 | from readthedocs.notifications.models import Notification  | 
48 | 46 | from readthedocs.oauth.constants import GITHUB  | 
49 | 47 | from readthedocs.oauth.services import GitHubService  | 
50 |  | -from readthedocs.oauth.services import registry  | 
51 | 48 | from readthedocs.oauth.tasks import attach_webhook  | 
52 | 49 | from readthedocs.oauth.utils import update_webhook  | 
53 | 50 | from readthedocs.projects.filters import ProjectListFilterSet  | 
@@ -434,34 +431,6 @@ class ImportView(PrivateViewMixin, TemplateView):  | 
434 | 431 |     template_name = "projects/project_import.html"  | 
435 | 432 |     wizard_class = ImportWizardView  | 
436 | 433 | 
 
  | 
437 |  | -    def get(self, request, *args, **kwargs):  | 
438 |  | -        """  | 
439 |  | -        Display list of repositories to import.  | 
440 |  | -
  | 
441 |  | -        Adds a warning to the listing if any of the accounts connected for the  | 
442 |  | -        user are not supported accounts.  | 
443 |  | -        """  | 
444 |  | -        deprecated_accounts = SocialAccount.objects.filter(  | 
445 |  | -            user=self.request.user  | 
446 |  | -        ).exclude(  | 
447 |  | -            provider__in=[service.allauth_provider.id for service in registry],  | 
448 |  | -        )  # yapf: disable  | 
449 |  | -        for account in deprecated_accounts:  | 
450 |  | -            provider_account = account.get_provider_account()  | 
451 |  | -            messages.error(  | 
452 |  | -                request,  | 
453 |  | -                format_html(  | 
454 |  | -                    _(  | 
455 |  | -                        "There is a problem with your {service} account, "  | 
456 |  | -                        "try reconnecting your account on your "  | 
457 |  | -                        '<a href="{url}">connected services page</a>.',  | 
458 |  | -                    ),  | 
459 |  | -                    service=provider_account.get_brand()["name"],  | 
460 |  | -                    url=reverse("socialaccount_connections"),  | 
461 |  | -                ),  | 
462 |  | -            )  | 
463 |  | -        return super().get(request, *args, **kwargs)  | 
464 |  | - | 
465 | 434 |     def post(self, request, *args, **kwargs):  | 
466 | 435 |         initial_data = {}  | 
467 | 436 |         initial_data["basics"] = {}  | 
 | 
0 commit comments