Merge branch 'bug/pretzel-fresh-install' into 'dev'

Fix Logic issues on Fresh Install Detect

See merge request crafty-controller/crafty-4!425
This commit is contained in:
Iain Powrie 2022-08-14 16:59:32 +00:00
commit 6a94417a63
3 changed files with 9 additions and 3 deletions

View File

@ -5,6 +5,7 @@ TBD
### Bug fixes
- Fix reaction tasks not firing ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/423))
- QOL task delay offset not following over on task edit ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/423))
- Fix Fresh Install Detection Logic issues ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/425))
### Tweaks
- Session Handling | Logout on browser close ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/424))
### Lang

View File

@ -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 [

View File

@ -30,9 +30,8 @@ class DatabaseBuilder:
def is_fresh_install(self):
try:
user = self.users_helper.get_by_id(1)
if user:
return False
num_user = self.users_helper.get_user_total()
return num_user <= 0
except:
return True