gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libeufin] branch master updated: sanity checks


From: gnunet
Subject: [libeufin] branch master updated: sanity checks
Date: Sun, 22 Aug 2021 11:57:26 +0200

This is an automated email from the git hooks/post-receive script.

ms pushed a commit to branch master
in repository libeufin.

The following commit(s) were added to refs/heads/master by this push:
     new 7d3d0f8  sanity checks
7d3d0f8 is described below

commit 7d3d0f8e95ff3fe9185cd78bcaa2fa7ca1d33ec1
Author: MS <ms@taler.net>
AuthorDate: Sat Aug 21 22:57:22 2021 -1100

    sanity checks
---
 sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt 
b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
index 0ce0b30..73498d4 100644
--- a/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
+++ b/sandbox/src/main/kotlin/tech/libeufin/sandbox/Main.kt
@@ -566,6 +566,13 @@ fun serverMain(dbName: String, port: Int) {
                         body.subscriber.partnerID,
                         body.subscriber.hostID
                     )
+                    val check = BankAccountEntity.find {
+                        BankAccountsTable.iban eq body.iban 
or(BankAccountsTable.label eq body.label)
+                    }.count()
+                    if (check > 0) throw SandboxError(
+                        HttpStatusCode.BadRequest,
+                        "Either IBAN or account label were already taken; 
please choose fresh ones"
+                    )
                     subscriber.bankAccount = BankAccountEntity.new {
                         iban = body.iban
                         bic = body.bic

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]