Merge branch 'refactor/cleanup-authentication-helpers' into 'dev'

Cleanup authentication helpers

See merge request crafty-controller/crafty-4!545
This commit is contained in:
Iain Powrie 2023-02-11 18:08:09 +00:00
commit 65a1459451
3 changed files with 3 additions and 4 deletions

View File

@ -5,7 +5,7 @@ TBD
### Bug fixes
- Fix exception related to page data on server start ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/544))
### Tweaks
TBD
- Cleanup authentication helpers ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/545))
### Lang
- Add additional translations to backups page strings ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/543))
<br><br>

View File

@ -13,7 +13,6 @@ logger = logging.getLogger(__name__)
class Authentication:
def __init__(self, helper):
self.helper = helper
self.secret = "my secret"
try:
self.secret = ManagementController.get_crafty_api_key()
if self.secret == "":

View File

@ -1013,7 +1013,7 @@ class Helpers:
for item in file_list:
if os.path.isdir(os.path.join(folder, item)):
dir_list.append(item)
elif str(item) != "crafty.sqlite":
elif str(item) != self.ignored_names:
unsorted_files.append(item)
file_list = sorted(dir_list, key=str.casefold) + sorted(
unsorted_files, key=str.casefold
@ -1054,7 +1054,7 @@ class Helpers:
for item in file_list:
if os.path.isdir(os.path.join(folder, item)):
dir_list.append(item)
elif str(item) != "crafty.sqlite":
elif str(item) != self.ignored_names:
unsorted_files.append(item)
file_list = sorted(dir_list, key=str.casefold) + sorted(
unsorted_files, key=str.casefold