From d32cf1614ad0635308bb9ea5fb32b3a576862bbb Mon Sep 17 00:00:00 2001 From: spla Date: Sat, 22 May 2021 13:09:25 +0200 Subject: [PATCH] Don't welcome new users if they are suspended --- welcome.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/welcome.py b/welcome.py index 093f193..512c935 100644 --- a/welcome.py +++ b/welcome.py @@ -118,7 +118,7 @@ if __name__ == '__main__': print("\nOnly 'ca', 'es' and 'en' languages are supported.\n") sys.exit(0) - + mastodon, mastodon_hostname = mastodon() mastodon_db, mastodon_db_user, welcome_db, welcome_db_user = db_config() @@ -319,7 +319,7 @@ if __name__ == '__main__': cur = conn.cursor() - cur.execute("select username, domain from accounts where (created_at + interval '" + interval_time + "' > (now() - interval '1 hour')) and domain is null and id in (select account_id from users where approved and not disabled)") + cur.execute("select username, domain from accounts where (created_at + interval '" + interval_time + "' > (now() - interval '1 hour')) and domain is null and suspended_at is null and id in (select account_id from users where approved and not disabled)") rows = cur.fetchall() @@ -447,7 +447,7 @@ if __name__ == '__main__': toot_text += mastodon_hostname + ' ' + welcomes_str + ':\n\n' toot_text += new_users_string + "\n" toot_text += "\n" - toot_text += "\n\n" + we_have_str + ' ' + str(current_id) + users_str + "\n\n" + toot_text += "\n\n" + we_have_str + ' ' + str(current_id) + ' ' + users_str + "\n\n" toot_text += hourly_change_string toot_text += daily_change_string toot_text += weekly_change_string