Only grab users with null usernames
This commit is contained in:
Родитель
eb7035fa43
Коммит
a6f0a144e0
|
@ -30,11 +30,14 @@ class Command(BaseCommand):
|
|||
# Doing this directly because I don't want to load 800k user objects
|
||||
query = """SELECT id, firstname, lastname, nickname
|
||||
FROM users
|
||||
WHERE modified > %s
|
||||
OR created > %s"""
|
||||
WHERE
|
||||
username IS NULL AND
|
||||
(modified > %s
|
||||
OR created > %s)"""
|
||||
cursor.execute(query, [date, date])
|
||||
else:
|
||||
cursor.execute("SELECT id, firstname, lastname, nickname FROM users")
|
||||
cursor.execute("""SELECT id, firstname, lastname, nickname FROM users
|
||||
WHERE username IS NULL""")
|
||||
|
||||
|
||||
data = cursor.fetchall()
|
||||
|
|
Загрузка…
Ссылка в новой задаче