Do not return deactivated portfolios in Portfolios.for_user
This commit is contained in:
parent
a91d438d1c
commit
94d8680361
@ -48,6 +48,7 @@ class PortfoliosQuery(Query):
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
.filter(Portfolio.deleted == False)
|
||||||
.order_by(Portfolio.name.asc())
|
.order_by(Portfolio.name.asc())
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
|
@ -219,3 +219,9 @@ def test_delete_failure_with_applications():
|
|||||||
Portfolios.delete(portfolio=portfolio)
|
Portfolios.delete(portfolio=portfolio)
|
||||||
|
|
||||||
assert not portfolio.deleted
|
assert not portfolio.deleted
|
||||||
|
|
||||||
|
|
||||||
|
def test_for_user_does_not_include_deleted_portfolios():
|
||||||
|
user = UserFactory.create()
|
||||||
|
PortfolioFactory.create(owner=user, deleted=True)
|
||||||
|
assert len(Portfolios.for_user(user)) == 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user