feat(kfet): block self deposit

This commit is contained in:
catvayor 2025-01-23 19:27:56 +01:00
parent 982c82ba31
commit e41b93e348
Signed by: lbailly
GPG key ID: CE3E645251AC63F3

View file

@ -1171,6 +1171,13 @@ def kpsul_perform_operations(request):
operationgroup.amount += operation.amount
if operation.type == Operation.DEPOSIT:
required_perms.add("kfet.perform_deposit")
if request.user.profile.account_kfet == on_acc:
data["errors"].append(
{
"code": "auto_deposit",
"message": ("Impossible de charger son propre trigramme"),
}
)
if operation.type == Operation.EDIT:
required_perms.add("kfet.edit_balance_account")
need_comment = True