Removed hardcoding of bank profile

This commit is contained in:
Rick Falkvinge
2018-04-25 08:08:36 +02:00
parent 33b72aad43
commit 3be35e6c02
2 changed files with 25 additions and 1 deletions
+16 -1
View File
@@ -187,8 +187,23 @@ namespace Swarmops.Logic.Financial
}
}
public ExternalBankDataProfile ExternalBankDataProfile
{
get
{
ExternalBankDataProfile oldProfile = ExternalBankDataProfileOldHack;
ExternalBankDataProfile newProfile = AutomationProfile.BankDataProfile;
if (oldProfile != null && newProfile != oldProfile)
{
throw new InvalidOperationException("Defensive programming for crucial part");
}
return newProfile;
}
}
private ExternalBankDataProfile ExternalBankDataProfileOldHack
{
get
{
@@ -263,6 +263,15 @@ namespace Swarmops.Site.Pages.Ledgers
};
}
if (profile.Currency == null) // uses presentation currency
{
return new AjaxCallResult
{
Success = true,
DisplayMessage = profile.Name
};
}
return new AjaxCallResult
{
Success = true,