mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 18:46:46 +00:00
Fixed issue with local vs external users. Code cleanup
This commit is contained in:
parent
6a05175b6c
commit
c3936b3151
@ -282,6 +282,14 @@ class Boot extends Loggable{
|
||||
// Make a transaction span the whole HTTP request
|
||||
S.addAround(DB.buildLoanWrapper)
|
||||
|
||||
val useMessageQueue = Props.getBool("messageQueue.createBankAccounts", false)
|
||||
if(useMessageQueue)
|
||||
try {
|
||||
BankAccountCreationListener.startListen
|
||||
} catch {
|
||||
case e: java.lang.ExceptionInInitializerError => logger.warn(s"BankAccountCreationListener Exception: $e")
|
||||
}
|
||||
|
||||
Mailer.devModeSend.default.set( (m : MimeMessage) => {
|
||||
logger.info("Would have sent email if not in dev mode: " + m.getContent)
|
||||
})
|
||||
@ -300,15 +308,6 @@ class Boot extends Loggable{
|
||||
XhtmlResponse((<html> <body>Something unexpected happened while serving the page at {r.uri}</body> </html>), S.htmlProperties.docType, List("Content-Type" -> "text/html; charset=utf-8"), Nil, 500, S.legacyIeCompatibilityMode)
|
||||
}
|
||||
}
|
||||
|
||||
val useMessageQueue = Props.getBool("messageQueue.createBankAccounts", false)
|
||||
if(useMessageQueue)
|
||||
try {
|
||||
BankAccountCreationListener.startListen
|
||||
} catch {
|
||||
case e: java.lang.ExceptionInInitializerError => logger.warn(s"BankAccountCreationListener Exception: $e")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
def schemifyAll() = {
|
||||
|
||||
@ -72,19 +72,15 @@ class OBPUser extends MegaProtoUser[OBPUser] with Logger {
|
||||
|
||||
def getProvider() = {
|
||||
if(provider.get == null) {
|
||||
info ("-------------------------------------------------------> NULL")
|
||||
Props.get("hostname","")
|
||||
} else if ( provider.get == "" || provider.get == Props.get("hostname","") ) {
|
||||
info ("-------------------------------------------------------> HOST")
|
||||
Props.get("hostname","")
|
||||
} else {
|
||||
info ("-------------------------------------------------------> EXTERNAL")
|
||||
provider.get
|
||||
}
|
||||
}
|
||||
|
||||
def createUnsavedApiUser() : APIUser = {
|
||||
info("[createUnsavedApiUser]===> displayName=" + displayName() + " email=" + email + " provider=" + provider)
|
||||
APIUser.create
|
||||
.name_(displayName())
|
||||
.email(email)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user