diff --git a/app/alias_utils.py b/app/alias_utils.py index b2a94664..8bd273d7 100644 --- a/app/alias_utils.py +++ b/app/alias_utils.py @@ -362,9 +362,7 @@ def delete_alias( ) else: if not DeletedAlias.get_by(email=alias.email): - deleted_alias = DeletedAlias( - email=alias.email, reason=reason, user_id=user.id - ) + deleted_alias = DeletedAlias(email=alias.email, reason=reason) Session.add(deleted_alias) Session.commit() LOG.i(f"Moving {alias} to global trash {deleted_alias}") diff --git a/tests/test_alias_utils.py b/tests/test_alias_utils.py index aef172dd..507b507a 100644 --- a/tests/test_alias_utils.py +++ b/tests/test_alias_utils.py @@ -31,9 +31,7 @@ def test_delete_alias(flask_client): delete_alias(alias, user) assert Alias.get_by(email=alias.email) is None - deleted_alias = DeletedAlias.get_by(email=alias.email) - assert deleted_alias is not None - assert deleted_alias.user_id == user.id + assert DeletedAlias.get_by(email=alias.email) def test_delete_alias_already_in_trash(flask_client):