瀏覽代碼

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

tags/3.0.0
Teknikode 2 年之前
父節點
當前提交
55bf97fe53
共有 1 個檔案被更改,包括 14 行新增7 行删除
  1. 14
    7
      Teknik/Areas/Admin/Controllers/AdminController.cs

+ 14
- 7
Teknik/Areas/Admin/Controllers/AdminController.cs 查看文件

@@ -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…
取消
儲存