This commit is contained in:
2023-02-21 23:15:23 +00:00
parent 27a43e5e38
commit 7d8bbb651d
7 changed files with 806 additions and 792 deletions

View File

@@ -124,7 +124,7 @@ namespace Sockeye.Api.Controllers
//is there a valid trial request
var req = await ct.TrialLicenseRequest.AsNoTracking().Where(z => z.EmailConfirmCode == code && z.Status == TrialRequestStatus.AwaitingEmailValidation).FirstOrDefaultAsync();
var req = await ct.TrialLicenseRequest.AsNoTracking().Where(z => z.EmailConfirmCode == code).FirstOrDefaultAsync();//&& z.Status == TrialRequestStatus.AwaitingEmailValidation
if (req == null)
{
return new ContentResult
@@ -135,6 +135,18 @@ namespace Sockeye.Api.Controllers
};
}
//Legit code but they already validated email, if so then just return that it's ok so they don't keep thinking something's wrong
//but there's no need to keep processing it, it's done
if (req.EmailValidated)
{
return new ContentResult
{
ContentType = "text/html",
StatusCode = 200,
Content = "<html><body><h4>Email validated!</h4><p>Your request will be reviewed and processed by our staff <strong>during business hours</strong>. You will receive an email with instructions for starting your AyaNova evaluation.</p></body></html>"
};
}
TrialLicenseRequestBiz biz = TrialLicenseRequestBiz.GetBiz(ct);
var tlr = await biz.GetAsync(req.Id);
if (tlr == null)

View File

@@ -565,9 +565,10 @@ namespace Sockeye
if (ServerBootConfig.SOCKEYE_PERMANENTLY_ERASE_DATABASE)
{
_newLog.LogWarning("SOCKEYE_PERMANENTLY_ERASE_DATABASE has been set - deleting and recreating database");
Util.DbUtil.DropAndRecreateDbAsync(_newLog).Wait();
AySchema.CheckAndUpdateAsync(dbContext, _newLog).Wait();
throw new InvalidOperationException("SOCKEYE_PERMANENTLY_ERASE_DATABASE has been set - Sockeye must be erased via psql to protect data from accidental deletion");
// _newLog.LogWarning("SOCKEYE_PERMANENTLY_ERASE_DATABASE has been set - deleting and recreating database");
// Util.DbUtil.DropAndRecreateDbAsync(_newLog).Wait();
// AySchema.CheckAndUpdateAsync(dbContext, _newLog).Wait();
}
@@ -663,12 +664,12 @@ namespace Sockeye
Console.WriteLine("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");
if (ServerBootConfig.SOCKEYE_PERMANENTLY_ERASE_DATABASE)
{
_newLog.LogWarning("SOCKEYE_PERMANENTLY_ERASE_DATABASE has been set - IMPORTING ROCKFISH");
GlobalBizSettingsBiz.ImportRockfish(_newLog).Wait();
_newLog.LogInformation("IMPORT COMPLETED");
}
// if (ServerBootConfig.SOCKEYE_PERMANENTLY_ERASE_DATABASE)
// {
// _newLog.LogWarning("SOCKEYE_PERMANENTLY_ERASE_DATABASE has been set - IMPORTING ROCKFISH");
// GlobalBizSettingsBiz.ImportRockfish(_newLog).Wait();
// _newLog.LogInformation("IMPORT COMPLETED");
// }
}

File diff suppressed because it is too large Load Diff

View File

@@ -41,7 +41,7 @@ namespace Sockeye.Biz
////////////////////////////////////////////////////////////////////////////////////////////////
//CREATE
//
internal async Task<TrialLicenseRequest> CreateAsync(TrialLicenseRequest newObject, bool importingDoNotNotify = false)
internal async Task<TrialLicenseRequest> CreateAsync(TrialLicenseRequest newObject)
{
await ValidateAsync(newObject, null);
if (HasErrors)
@@ -53,7 +53,6 @@ namespace Sockeye.Biz
//Process a new request / Generate an email confirm code
newObject.EmailConfirmCode = StringUtil.GenFetchCode();
newObject.EmailValidated = false;
if (!importingDoNotNotify)
newObject.Status = TrialRequestStatus.AwaitingEmailValidation;
await ct.TrialLicenseRequest.AddAsync(newObject);
@@ -63,8 +62,7 @@ namespace Sockeye.Biz
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newObject.Tags, null);
if (!importingDoNotNotify)
{
//## ------------------ DEFAULT NOTIFICATIONS TO CUSTOMER ----------------
//ValidateEmail request message,RavenTrialApproved (which sends pending manual generation message) and RavenTrialRejected messages are sent in this block
//
@@ -93,7 +91,7 @@ namespace Sockeye.Biz
AddError(ApiErrorCode.API_SERVER_ERROR, null, err + ExceptionUtil.ExtractAllExceptionMessages(ex));
return null;
}
}
await HandlePotentialNotificationEvent(SockEvent.Created, newObject);
return newObject;
@@ -591,7 +589,7 @@ namespace Sockeye.Biz
SockType = BizType,
ObjectId = o.Id,
NotifySubscriptionId = sub.Id,
Name = $"{o.CompanyName} - trial license requested"
Name = o.CompanyName
};
await ct.NotifyEvent.AddAsync(n);
log.LogDebug($"Adding NotifyEvent: [{n.ToString()}]");

View File

@@ -4,8 +4,8 @@
</PropertyGroup>
<PropertyGroup>
<GenerateFullPaths>true</GenerateFullPaths>
<Version>8.0.0</Version>
<FileVersion>8.0.0.0</FileVersion>
<Version>8.0.3</Version>
<FileVersion>8.0.3.0</FileVersion>
<ApplicationIcon>sockeye.ico</ApplicationIcon>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<noWarn>1591</noWarn>

View File

@@ -767,7 +767,7 @@ $BODY$ LANGUAGE PLPGSQL STABLE");
//////////////////////////////////////////////////
//
// 8.0.14 additions for job feedback
// 8.0.24 additions for job feedback
//
if (currentSchema < 8)
{

View File

@@ -5,7 +5,7 @@ namespace Sockeye.Util
/// </summary>
internal static class SockeyeVersion
{
public const string VersionString = "8.0.0";
public const string VersionString = "8.0.3";
public const string FullNameAndVersion = "Sockeye server " + VersionString;
public const string CurrentApiVersion="v8";
}//eoc