Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/ldap_protocol/ldap_requests/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
KRBAPIAddPrincipalError,
KRBAPIConnectionError,
KRBAPIDeletePrincipalError,
KRBAPIPrincipalNotFoundError,
)
from ldap_protocol.ldap_codes import LDAPCodes
from ldap_protocol.ldap_responses import INVALID_ACCESS_RESPONSE, AddResponse
Expand Down Expand Up @@ -456,7 +457,10 @@ async def handle( # noqa: C901
# stub cannot raise error
if user:
# NOTE: Try to delete existing principal if any
with contextlib.suppress(KRBAPIDeletePrincipalError):
with contextlib.suppress(
KRBAPIDeletePrincipalError,
KRBAPIPrincipalNotFoundError,
):
await ctx.kadmin.del_principal(
user.get_upn_prefix(),
)
Expand Down
2 changes: 1 addition & 1 deletion interface