This commit is contained in:
2020-06-13 19:23:39 +00:00
parent 055ce0ee6c
commit b2dc8977ec

View File

@@ -40,8 +40,12 @@ namespace rockfishCore.Controllers
}
else
{
//is there a valid trial request
//is there an Approved UnFetched trial request for this DB ID?
var req = await ct.TrialRequest.Where(z => z.DbId == dbid && z.DtFetched == null && z.Status == TrialRequest.TrialRequestStatus.Approved).FirstOrDefaultAsync();
if (req == null)
{
return NotFound();
}
LicenseKey = req.Key;
req.DtFetched = DateUtil.NowAsEpoch();
await ct.SaveChangesAsync();
@@ -60,20 +64,7 @@ namespace rockfishCore.Controllers
}
});
//
// //This is to simulate the scenarios where there is no license to return
// //either due to no current account / canceled or simply no license exists
// //Changes here must be reflected in RAVEN Util.License.Fetch block
// bool bTestStatusOtherThanOk = false;
// if (bTestStatusOtherThanOk)
// {
// return Json(new {Status="NONE", Reason="No license"});
// //return Json(new {Status="Canceled", Reason="Non payment"});
// }
// else
// {
// return Ok(RavenKeyFactory.GetRavenTestKey(dbid));
// }
}