mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-15 17:51:28 +00:00
Miscellaneous website/moderation/notification fixes (#940)
This commit is contained in:
parent
0de5edca6e
commit
69855406f5
4 changed files with 11 additions and 11 deletions
|
@ -89,16 +89,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.";
|
|||
|
||||
StringBuilder builder = new();
|
||||
|
||||
// ReSharper disable once ForCanBeConvertedToForeach
|
||||
// Suppressing this because we need to modify the list while iterating over it.
|
||||
for (int i = 0; i < notifications.Count; i++)
|
||||
foreach (NotificationEntity notification in notifications)
|
||||
{
|
||||
NotificationEntity n = notifications[i];
|
||||
|
||||
builder.AppendLine(LighthouseSerializer.Serialize(this.HttpContext.RequestServices,
|
||||
GameNotification.CreateFromEntity(n)));
|
||||
GameNotification.CreateFromEntity(notification)));
|
||||
|
||||
n.IsDismissed = true;
|
||||
notification.IsDismissed = true;
|
||||
}
|
||||
|
||||
await this.database.SaveChangesAsync();
|
||||
|
|
|
@ -43,7 +43,7 @@ public class SlotPage : BaseLayout
|
|||
// Determine if user can view slot according to creator's privacy settings
|
||||
this.CanViewSlot = slot.Creator.LevelVisibility.CanAccess(isAuthenticated, isOwner);
|
||||
|
||||
if ((slot.Hidden || slot.SubLevel && (this.User == null && this.User != slot.Creator)) && !(this.User?.IsModerator ?? false))
|
||||
if ((slot.Hidden || slot.SubLevel && (this.User == null || this.User != slot.Creator)) && !(this.User?.IsModerator ?? false))
|
||||
return this.NotFound();
|
||||
|
||||
string slotSlug = slot.GenerateSlug();
|
||||
|
|
|
@ -68,6 +68,7 @@ public class UserPage : BaseLayout
|
|||
this.Slots = await this.Database.Slots.Include(p => p.Creator)
|
||||
.OrderByDescending(s => s.LastUpdated)
|
||||
.Where(p => p.CreatorId == userId)
|
||||
.Where(p => p.Creator != null && (!p.SubLevel || p.Creator == this.User))
|
||||
.Take(10)
|
||||
.ToListAsync();
|
||||
|
||||
|
|
|
@ -33,6 +33,9 @@ public class DismissExpiredCasesTask : IRepeatingTask
|
|||
{
|
||||
@case.DismissedAt = DateTime.UtcNow;
|
||||
@case.DismisserUsername = "maintenance task";
|
||||
|
||||
@case.Processed = false;
|
||||
|
||||
Logger.Info($"Dismissed expired case {@case.CaseId}", LogArea.Maintenance);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue