diff --git a/common/utils.py b/common/utils.py index 190f4317..7ca92963 100644 --- a/common/utils.py +++ b/common/utils.py @@ -4,7 +4,7 @@ from discord import SyncWebhook from django.conf import settings -from django.core.exceptions import PermissionDenied +from django.core.exceptions import ObjectDoesNotExist, PermissionDenied from django.core.signing import b62_decode, b62_encode from django.http import Http404, HttpRequest, HttpResponseRedirect, QueryDict from django.utils import timezone @@ -87,7 +87,7 @@ def wrapper(request, user_name, *args, **kwargs): try: target = APIdentity.get_by_handle(user_name, match_linked=True) - except APIdentity.DoesNotExist: + except ObjectDoesNotExist: raise Http404(_("User not found")) target_user = target.user viewer = None diff --git a/mastodon/views/common.py b/mastodon/views/common.py index 763fb398..daab3031 100644 --- a/mastodon/views/common.py +++ b/mastodon/views/common.py @@ -102,4 +102,11 @@ def disconnect_identity(request, account): _("You cannot disconnect last login identity."), ) account.delete() + messages.add_message( + request, + messages.INFO, + _("Login information about {handle} has been removed.").format( + handle=account.handle + ), + ) return redirect(reverse("users:info"))