Merge pull request #1381 from LemmyNet/fix_mod_bans_and_adds

Fixing modlog not showing bans and adds. Fixes #1376
This commit is contained in:
Nutomic 2021-01-26 16:57:49 +00:00 committed by GitHub
commit ea59cf16e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 4 deletions

View File

@ -31,7 +31,7 @@ impl ModAddCommunityView {
let mut query = mod_add_community::table
.inner_join(user_::table.on(mod_add_community::mod_user_id.eq(user_::id)))
.inner_join(community::table)
.inner_join(user_alias_1::table.on(mod_add_community::other_user_id.eq(user_::id)))
.inner_join(user_alias_1::table.on(mod_add_community::other_user_id.eq(user_alias_1::id)))
.select((
mod_add_community::all_columns,
User_::safe_columns_tuple(),

View File

@ -27,7 +27,7 @@ impl ModAddView {
) -> Result<Vec<Self>, Error> {
let mut query = mod_add::table
.inner_join(user_::table.on(mod_add::mod_user_id.eq(user_::id)))
.inner_join(user_alias_1::table.on(mod_add::other_user_id.eq(user_::id)))
.inner_join(user_alias_1::table.on(mod_add::other_user_id.eq(user_alias_1::id)))
.select((
mod_add::all_columns,
User_::safe_columns_tuple(),

View File

@ -31,7 +31,9 @@ impl ModBanFromCommunityView {
let mut query = mod_ban_from_community::table
.inner_join(user_::table.on(mod_ban_from_community::mod_user_id.eq(user_::id)))
.inner_join(community::table)
.inner_join(user_alias_1::table.on(mod_ban_from_community::other_user_id.eq(user_::id)))
.inner_join(
user_alias_1::table.on(mod_ban_from_community::other_user_id.eq(user_alias_1::id)),
)
.select((
mod_ban_from_community::all_columns,
User_::safe_columns_tuple(),

View File

@ -27,7 +27,7 @@ impl ModBanView {
) -> Result<Vec<Self>, Error> {
let mut query = mod_ban::table
.inner_join(user_::table.on(mod_ban::mod_user_id.eq(user_::id)))
.inner_join(user_alias_1::table.on(mod_ban::other_user_id.eq(user_::id)))
.inner_join(user_alias_1::table.on(mod_ban::other_user_id.eq(user_alias_1::id)))
.select((
mod_ban::all_columns,
User_::safe_columns_tuple(),