admin: fix
Some checks reported warnings
CI / Check CI (pull_request) Has been cancelled

This commit is contained in:
radex 2024-07-10 11:30:11 +02:00
parent 06e4b8f40e
commit 25a37c9876
Signed by: radex
SSH key fingerprint: SHA256:hvqRXAGG1h89yqnS+cyFTLKQbzjWD4uXIqw7Y+0ws30

View file

@ -151,9 +151,6 @@ class AdminMixin:
old_value = self.attr.value.decode() if hasattr(self, "attr") else None
new_value = form.value.data if hasattr(form, "value") else None
profile = app.get_profile(self.dn)
assert profile is not None
title_prefix = {"add": "Adding", "mod": "Modifying", "del": "Deleting"}[
self.kind
]
@ -163,7 +160,7 @@ class AdminMixin:
text = f"{old_text}\n{new_text}".strip()
email.send_papertrail(
f"{title_prefix} {attr_name} for user {profile.username}",
f"{title_prefix} {attr_name} for user {self.dn}",
text,
)