mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Make fresh install more efficient
This commit is contained in:
parent
675912a0b6
commit
f4660fb36c
@ -107,6 +107,12 @@ class HelperUsers:
|
||||
usernames.append(user.username)
|
||||
return usernames
|
||||
|
||||
@staticmethod
|
||||
def get_user_total():
|
||||
count = Users.select().where(Users.username != "system").count()
|
||||
print(count)
|
||||
return count
|
||||
|
||||
@staticmethod
|
||||
def get_all_user_ids() -> t.List[int]:
|
||||
return [
|
||||
|
@ -30,11 +30,8 @@ class DatabaseBuilder:
|
||||
|
||||
def is_fresh_install(self):
|
||||
try:
|
||||
usern = self.users_helper.get_all_usernames()
|
||||
if len(usern) > 0:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
num_user = self.users_helper.get_user_total()
|
||||
return num_user <= 0
|
||||
except:
|
||||
return True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user