Browse Source

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

tags/3.0.0
Teknikode 2 years ago
parent
commit
55bf97fe53
1 changed files with 14 additions and 7 deletions
  1. 14
    7
      Teknik/Areas/Admin/Controllers/AdminController.cs

+ 14
- 7
Teknik/Areas/Admin/Controllers/AdminController.cs View File

@@ -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