Skip to content

Commit

Permalink
Fix issue with empty notification in row #2
Browse files Browse the repository at this point in the history
  • Loading branch information
wh0o7 committed Sep 30, 2023
1 parent 08dd1d1 commit 1a6100f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions TeachersTimetable/Services/ParseService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.RegularExpressions;
using MongoDB.Driver;
using MongoDB.Driver;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Interactions;
Expand Down Expand Up @@ -162,11 +161,12 @@ public async Task ParseDay()

var teacherInfoFromTimetable =
Timetable.LastOrDefault()?.TeacherInfos.FirstOrDefault(t => t.Name == teacherInfo.Name);
if (teacherInfo.Lessons.Count < 1 && teacherInfoFromTimetable?.Lessons is not null &&
teacherInfoFromTimetable.Lessons.Count > 0)
if (teacherInfo.Lessons.Count < 1)
{
notificationUsersList.AddRange((await this._mongoService.Database.GetCollection<User>("Users")
.FindAsync(u => u.Teacher != null && u.Notifications && u.Teacher == teacherInfo.Name)).ToList());
if (teacherInfoFromTimetable?.Lessons is not null && teacherInfoFromTimetable.Lessons.Count > 0)
notificationUsersList.AddRange((await this._mongoService.Database.GetCollection<User>("Users")
.FindAsync(u => u.Teacher != null && u.Notifications && u.Teacher == teacherInfo.Name))
.ToList());
continue;
}

Expand Down

0 comments on commit 1a6100f

Please sign in to comment.