forked from importers/git-importer
Import creator users as well
This commit is contained in:
parent
bbf1bc2fda
commit
fce8aac001
15
lib/user.py
15
lib/user.py
@ -52,6 +52,7 @@ class User:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def missing_users(db):
|
def missing_users(db):
|
||||||
|
missing_users = set()
|
||||||
with db.cursor() as cur:
|
with db.cursor() as cur:
|
||||||
cur.execute(
|
cur.execute(
|
||||||
"""SELECT DISTINCT revisions.userid
|
"""SELECT DISTINCT revisions.userid
|
||||||
@ -60,5 +61,15 @@ class User:
|
|||||||
FAKE_ACCOUNTS
|
FAKE_ACCOUNTS
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
missing_users = [row[0] for row in cur.fetchall()]
|
for row in cur.fetchall():
|
||||||
return missing_users
|
missing_users.add(row[0])
|
||||||
|
cur.execute(
|
||||||
|
"""SELECT DISTINCT requests.creator
|
||||||
|
FROM requests LEFT JOIN users ON requests.creator=users.userid
|
||||||
|
WHERE users.userid IS NULL AND requests.creator NOT IN {}""".format(
|
||||||
|
FAKE_ACCOUNTS
|
||||||
|
)
|
||||||
|
)
|
||||||
|
for row in cur.fetchall():
|
||||||
|
missing_users.add(row[0])
|
||||||
|
return sorted(missing_users)
|
||||||
|
Loading…
Reference in New Issue
Block a user