Skip to content

Commit

Permalink
clean up for PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt-Spence committed Jan 14, 2025
1 parent bc9bc8f commit 4c737ba
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
4 changes: 0 additions & 4 deletions src/registrar/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2882,10 +2882,6 @@ def test_transfer_user_throws_transfer_and_delete_success_messages(self):
submit_form["selected_user"] = self.user2.pk
after_submit = submit_form.submit().follow()

print("mock_success_message.call_args_list:")
for call in mock_success_message.call_args_list:
print(call)

self.assertContains(after_submit, "<h1>Change user</h1>")

mock_success_message.assert_any_call(
Expand Down
9 changes: 2 additions & 7 deletions src/registrar/views/transfer_user.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
import logging
from django.db import transaction
from django.db.models import Manager, ForeignKey, OneToOneField, ManyToManyField, ManyToOneRel
from django.db.models import ForeignKey, OneToOneField, ManyToManyField, ManyToOneRel

from django.shortcuts import render, get_object_or_404, redirect
from django.views import View
from registrar import models
from registrar.models.domain import Domain
from registrar.models.domain_information import DomainInformation
from registrar.models.domain_request import DomainRequest
from registrar.models.portfolio import Portfolio
from registrar.models.user import User
from django.contrib.admin import site
from django.contrib import messages

from registrar.models.user_domain_role import UserDomainRole
from registrar.models.user_portfolio_permission import UserPortfolioPermission
from registrar.models.verified_by_staff import VerifiedByStaff
from typing import Any, List
from typing import List

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -85,7 +81,6 @@ def post(self, request, user_id):
logger.debug("Deleting old user")
selected_user.delete()
messages.success(request, f"Deleted {selected_user} {selected_user.username}")

except Exception as e:
messages.error(request, f"An error occurred during the transfer: {e}")
logger.error(f"An error occurred during the transfer: {e}", exc_info=True)
Expand Down

0 comments on commit 4c737ba

Please sign in to comment.