Skip to content

Commit

Permalink
revert: userid storing on deleted alias (#2305)
Browse files Browse the repository at this point in the history
  • Loading branch information
cquintana92 authored Nov 6, 2024
1 parent 31c8a76 commit a8ca2d3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions app/alias_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
4 changes: 1 addition & 3 deletions tests/test_alias_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit a8ca2d3

Please sign in to comment.