diff --git a/test/ClinicalScheduler/EmailNotificationTest.cs b/test/ClinicalScheduler/EmailNotificationTest.cs index 2076eb862..1ea3e8f38 100644 --- a/test/ClinicalScheduler/EmailNotificationTest.cs +++ b/test/ClinicalScheduler/EmailNotificationTest.cs @@ -119,8 +119,8 @@ private async Task AddTestWeekGradYearAsync(int weekId, int gradYear = 2025, int await _context.Weeks.AddAsync(new Week { WeekId = weekId, - DateStart = DateTime.UtcNow.AddDays(-7 * (10 - weekId)), - DateEnd = DateTime.UtcNow.AddDays(-7 * (10 - weekId) + 6), + DateStart = DateTime.UtcNow.AddDays(-7.0 * (10 - weekId)), + DateEnd = DateTime.UtcNow.AddDays(-7.0 * (10 - weekId) + 6), TermCode = 202501 }); } diff --git a/test/ClinicalScheduler/TestDataBuilder.cs b/test/ClinicalScheduler/TestDataBuilder.cs index 4dfe853f9..d0420c539 100644 --- a/test/ClinicalScheduler/TestDataBuilder.cs +++ b/test/ClinicalScheduler/TestDataBuilder.cs @@ -179,7 +179,7 @@ public static Person CreatePerson(string mothraId, string firstName = "Test", st /// public static Week CreateWeek(int weekId, DateTime? startDate = null) { - var start = startDate ?? DateTime.UtcNow.AddDays(-7 * (10 - weekId)); + var start = startDate ?? DateTime.UtcNow.AddDays(-7.0 * (10 - weekId)); return new Week { WeekId = weekId, diff --git a/web/Areas/Curriculum/Services/TermCodeService.cs b/web/Areas/Curriculum/Services/TermCodeService.cs index 4b1695f23..a49d8066e 100644 --- a/web/Areas/Curriculum/Services/TermCodeService.cs +++ b/web/Areas/Curriculum/Services/TermCodeService.cs @@ -36,7 +36,7 @@ static public string GetTermCodeDescription(int termCode) default: desc = "Unknown Term"; break; } - return string.Format("{0} {1}", desc, year.ToString()); + return string.Format("{0} {1}", desc, year); } public async Task> GetTerms(string? TermType = null, bool? current = null, bool? currentMulti = null) diff --git a/web/Areas/Effort/Services/VerificationService.cs b/web/Areas/Effort/Services/VerificationService.cs index 99798c431..6881104e1 100644 --- a/web/Areas/Effort/Services/VerificationService.cs +++ b/web/Areas/Effort/Services/VerificationService.cs @@ -770,15 +770,9 @@ private VerificationReminderViewModel BuildVerificationEmailViewModel( var useWeeksForClinical = termCode >= EffortConstants.ClinicalAsWeeksStartTermCode; // Due date: ExpectedCloseDate - 7 days if set, otherwise fallback to Now + 7 - DateTime dueDate; - if (expectedCloseDate.HasValue) - { - dueDate = expectedCloseDate.Value.AddDays(-_settings.VerificationReplyDays); - } - else - { - dueDate = DateTime.Now.AddDays(_settings.VerificationReplyDays); - } + DateTime dueDate = expectedCloseDate.HasValue + ? expectedCloseDate.Value.AddDays(-_settings.VerificationReplyDays) + : DateTime.Now.AddDays(_settings.VerificationReplyDays); var isPastDue = DateTime.Now.Date > dueDate.Date; var replyByDate = dueDate.ToString("M/d/yy"); diff --git a/web/Classes/HttpHelper.cs b/web/Classes/HttpHelper.cs index 6a9f25f57..89cad3e09 100644 --- a/web/Classes/HttpHelper.cs +++ b/web/Classes/HttpHelper.cs @@ -18,7 +18,7 @@ public static class HttpHelper private static IDataProtectionProvider? dataProtectionProvider; /// - /// Helper functions constructor (gets injected with the memeory cache object) + /// Helper functions constructor (gets injected with the memory cache object) /// public static void Configure(IMemoryCache? memoryCache, IConfiguration? configurationSettings, IWebHostEnvironment env, IHttpContextAccessor? httpContextAccessor, IAuthorizationService? authorizationService, IDataProtectionProvider? dataProtectionProvider) { diff --git a/web/Controllers/HomeController.cs b/web/Controllers/HomeController.cs index bb91938f5..56db71dad 100644 --- a/web/Controllers/HomeController.cs +++ b/web/Controllers/HomeController.cs @@ -313,7 +313,7 @@ private async Task AuthenticateCasLogin(string? ticket, string? r // uncommenting this line will log what CAS is sending. When the user in question logs in while trying to access our site if (string.IsNullOrEmpty(validatedUserName)) { - HttpHelper.Logger.Log(LogLevel.Warn, "No username. CAS response: " + doc); + HttpHelper.Logger.Log(LogLevel.Warn, "No username. CAS response: " + LogSanitizer.SanitizeString(doc.ToString())); } if (!string.IsNullOrEmpty(validatedUserName))