mirror of
https://github.com/LemmyNet/lemmy
synced 2024-11-10 06:54:12 +00:00
Fix scheduled task to delete users with denied applications (#4907)
After an admin interacted with an application it can only be accepted or denied. Denial reasons are not required by Lemmys backend, even though they're mandatory in Lemmy-UI, and therefore they are not a reliable indicator of an application being denied. This aligns the cleanup logic with the logic used for the unread application count.
This commit is contained in:
parent
254ef6dab3
commit
76a2c6e79b
1 changed files with 2 additions and 2 deletions
|
@ -115,11 +115,11 @@ impl LocalUser {
|
||||||
let conn = &mut get_conn(pool).await?;
|
let conn = &mut get_conn(pool).await?;
|
||||||
|
|
||||||
// Make sure:
|
// Make sure:
|
||||||
// - The deny reason exists
|
// - An admin has interacted with the application
|
||||||
// - The app is older than a week
|
// - The app is older than a week
|
||||||
// - The accepted_application is false
|
// - The accepted_application is false
|
||||||
let old_denied_registrations = registration_application::table
|
let old_denied_registrations = registration_application::table
|
||||||
.filter(registration_application::deny_reason.is_not_null())
|
.filter(registration_application::admin_id.is_not_null())
|
||||||
.filter(registration_application::published.lt(now() - 1.week()))
|
.filter(registration_application::published.lt(now() - 1.week()))
|
||||||
.select(registration_application::local_user_id);
|
.select(registration_application::local_user_id);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue