From 841692addb935ecc668b4dc84879be1f871ab02a Mon Sep 17 00:00:00 2001 From: jvyden Date: Tue, 30 Nov 2021 19:06:30 -0500 Subject: [PATCH] Fix blank labels on slot page & blank creator --- ProjectLighthouse/Pages/SlotPage.cshtml | 2 +- ProjectLighthouse/Pages/SlotPage.cshtml.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ProjectLighthouse/Pages/SlotPage.cshtml b/ProjectLighthouse/Pages/SlotPage.cshtml index 75145e55..5faf620d 100644 --- a/ProjectLighthouse/Pages/SlotPage.cshtml +++ b/ProjectLighthouse/Pages/SlotPage.cshtml @@ -31,7 +31,7 @@

Tags

- @foreach (string label in Model.Slot.AuthorLabels.Split(",")) + @foreach (string label in Model.Slot.AuthorLabels.Split(",").Where(label => !string.IsNullOrEmpty(label))) {
@label.Replace("LABEL_", "")
} diff --git a/ProjectLighthouse/Pages/SlotPage.cshtml.cs b/ProjectLighthouse/Pages/SlotPage.cshtml.cs index bd2de3ab..af2bfd60 100644 --- a/ProjectLighthouse/Pages/SlotPage.cshtml.cs +++ b/ProjectLighthouse/Pages/SlotPage.cshtml.cs @@ -17,7 +17,7 @@ namespace LBPUnion.ProjectLighthouse.Pages public async Task OnGet([FromRoute] int id) { - Slot? slot = await this.Database.Slots.FirstOrDefaultAsync(s => s.SlotId == id); + Slot? slot = await this.Database.Slots.Include(s => s.Creator).FirstOrDefaultAsync(s => s.SlotId == id); if (slot == null) return this.NotFound(); this.Slot = slot;