mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-19 09:45:28 +01:00
Merge branch 'bug/import-user-error' into 'bug/tz-fallback'
Bug/import user error See merge request crafty-controller/crafty-4!332
This commit is contained in:
commit
7e7557f530
@ -38,9 +38,19 @@ class Import3:
|
|||||||
# If there is only one user to import json needs to call the data differently
|
# If there is only one user to import json needs to call the data differently
|
||||||
if isinstance(json_data, list):
|
if isinstance(json_data, list):
|
||||||
for user in json_data:
|
for user in json_data:
|
||||||
|
if str(user["username"]).lower() != "admin":
|
||||||
HelperUsers.add_rawpass_user(user["username"], user["password"])
|
HelperUsers.add_rawpass_user(user["username"], user["password"])
|
||||||
Console.info(f"Imported user {user['username']} from Crafty 3")
|
Console.info(f"Imported user {user['username']} from Crafty 3")
|
||||||
logger.info(f"Imported user {user['username']} from Crafty 3")
|
logger.info(f"Imported user {user['username']} from Crafty 3")
|
||||||
|
else:
|
||||||
|
logger.info("Cannot create duplicate Admin account...skipping.")
|
||||||
|
else:
|
||||||
|
if str(json_data["username"]).lower() != "admin":
|
||||||
|
HelperUsers.add_rawpass_user(
|
||||||
|
json_data["username"], json_data["password"]
|
||||||
|
)
|
||||||
|
Console.info(f"Imported user {json_data['username']} from Crafty 3")
|
||||||
|
logger.info(f"Imported user {json_data['username']} from Crafty 3")
|
||||||
else:
|
else:
|
||||||
Console.info(
|
Console.info(
|
||||||
"There is only one user detected. "
|
"There is only one user detected. "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user