mirror of
https://github.com/simple-login/app.git
synced 2024-11-16 08:58:30 +01:00
revert: userid storing on deleted alias (#2305)
This commit is contained in:
parent
31c8a766be
commit
a8ca2d3d37
2 changed files with 2 additions and 6 deletions
|
@ -362,9 +362,7 @@ def delete_alias(
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
if not DeletedAlias.get_by(email=alias.email):
|
if not DeletedAlias.get_by(email=alias.email):
|
||||||
deleted_alias = DeletedAlias(
|
deleted_alias = DeletedAlias(email=alias.email, reason=reason)
|
||||||
email=alias.email, reason=reason, user_id=user.id
|
|
||||||
)
|
|
||||||
Session.add(deleted_alias)
|
Session.add(deleted_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}")
|
||||||
|
|
|
@ -31,9 +31,7 @@ def test_delete_alias(flask_client):
|
||||||
|
|
||||||
delete_alias(alias, user)
|
delete_alias(alias, user)
|
||||||
assert Alias.get_by(email=alias.email) is None
|
assert Alias.get_by(email=alias.email) is None
|
||||||
deleted_alias = DeletedAlias.get_by(email=alias.email)
|
assert DeletedAlias.get_by(email=alias.email)
|
||||||
assert deleted_alias is not None
|
|
||||||
assert deleted_alias.user_id == user.id
|
|
||||||
|
|
||||||
|
|
||||||
def test_delete_alias_already_in_trash(flask_client):
|
def test_delete_alias_already_in_trash(flask_client):
|
||||||
|
|
Loading…
Reference in a new issue