Skip to content

Commit 407f731

Browse files
committed
Fixing #149
1 parent 8fcc5d2 commit 407f731

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Web/Controllers/InvitationsController.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ public ActionResult Index()
4747
return NotFound("Could not find user");
4848
}
4949

50-
var invites = db.OrganisationInvites.Where(uc => uc.InviteEmail.ToLower() == CurrentUser.Email.ToLower() && uc.AcceptedOn == null && uc.RejectedOn == null);
50+
var invites = db
51+
.OrganisationInvites
52+
.Include(c => c.CreatedBy)
53+
.Where(uc => uc.AcceptedOn == null && uc.RejectedOn == null)
54+
.ToList()
55+
.Where(uc => string.Compare(uc.InviteEmail, CurrentUser.Email, StringComparison.OrdinalIgnoreCase) == 0);
5156

5257
if (invites.Any() == false)
5358
{
@@ -57,9 +62,7 @@ public ActionResult Index()
5762

5863
List<InvitationViewModel> viewModels = new List<InvitationViewModel>();
5964

60-
foreach(var orgGrp in invites
61-
.Include(c => c.CreatedBy)
62-
.GroupBy(c => c.OrganisationId))
65+
foreach (var orgGrp in invites.GroupBy(c => c.OrganisationId))
6366
{
6467
InvitationViewModel viewModel = new InvitationViewModel
6568
{

0 commit comments

Comments
 (0)