Fix: Add alias delete event to contain email

This commit is contained in:
Adrià Casajús 2024-09-06 18:23:12 +02:00
parent 9f33764068
commit 1ba97eef6e
No known key found for this signature in database
GPG Key ID: F0033226A5AFC9B9

View File

@ -363,11 +363,16 @@ def delete_alias(
Session.commit() Session.commit()
LOG.i(f"Moving {alias} to global trash {deleted_alias}") LOG.i(f"Moving {alias} to global trash {deleted_alias}")
alias_id = alias.id
alias_email = alias.email
Alias.filter(Alias.id == alias.id).delete() Alias.filter(Alias.id == alias.id).delete()
Session.commit() Session.commit()
EventDispatcher.send_event( EventDispatcher.send_event(
user, EventContent(alias_deleted=AliasDeleted(alias_id=alias.id)) user,
EventContent(
alias_deleted=AliasDeleted(alias_id=alias_id, alias_email=alias_email)
),
) )
if commit: if commit:
Session.commit() Session.commit()