Browse Source

Fixed issue where exception from user info was stopping showing results in admin search.

pull/111/head
Teknikode 5 years ago
parent
commit
55bf97fe53
  1. 21
      Teknik/Areas/Admin/Controllers/AdminController.cs

21
Teknik/Areas/Admin/Controllers/AdminController.cs

@ -64,15 +64,22 @@ namespace Teknik.Areas.Admin.Controllers @@ -64,15 +64,22 @@ namespace Teknik.Areas.Admin.Controllers
{
foreach (Users.Models.User user in results)
{
SearchResultViewModel model = new SearchResultViewModel();
model.Username = user.Username;
if (Config.EmailConfig.Enabled)
try
{
model.Email = string.Format("{0}@{1}", user.Username, Config.EmailConfig.Domain);
SearchResultViewModel model = new SearchResultViewModel();
model.Username = user.Username;
if (Config.EmailConfig.Enabled)
{
model.Email = string.Format("{0}@{1}", user.Username, Config.EmailConfig.Domain);
}
model.JoinDate = user.JoinDate;
model.LastSeen = UserHelper.GetLastAccountActivity(db, Config, user);
models.Add(model);
}
catch (Exception ex)
{
// Skip this result
}
model.JoinDate = user.JoinDate;
model.LastSeen = UserHelper.GetLastAccountActivity(db, Config, user);
models.Add(model);
}
}

Loading…
Cancel
Save