Skip to content
Snippets Groups Projects
Commit 9135c0ea authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

Fix pylint unnecessary-dunder-call

parent f32873e3
No related branches found
No related tags found
1 merge request!131WIP: Fix linting
......@@ -26,7 +26,7 @@ size = 1000
db = dataset.connect(f"sqlite:///{rcfg.db_path}/user_reg.db")
table = db["user_state"]
if table.__len__() > 0 and not args.force:
if len(table) > 0 and not args.force:
print("table user_state not empty, abort.")
sys.exit()
......
......@@ -31,7 +31,7 @@ def create_account(msg):
msg["success"] = False
# Bright command to create user
if str(rcfg.bright_cm_version).split(".")[0] == "8":
if str(rcfg.bright_cm_version).split(".", maxsplit=1)[0] == "8":
cmd = "/cm/local/apps/cmd/bin/cmsh -c "
cmd += f'"user; add {username}; set userid {uid}; set email {email};'
cmd += f'set commonname \\"{fullname}\\"; '
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment