Skip to content

Commit

Permalink
🐛 Fix create_api_token management command
Browse files Browse the repository at this point in the history
  • Loading branch information
pajowu committed Dec 3, 2023
1 parent 4434016 commit 25a8fb2
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion backend/scripts/create_api_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
parser = argparse.ArgumentParser()
parser.add_argument("--name", required=True)
args = parser.parse_args()
with SessionContextManager() as session:
with SessionContextManager(path="management_command:create_api_token") as session:
token = create_api_token(session=session, name=args.name)
print(f"Token created: {token.token}")
2 changes: 1 addition & 1 deletion backend/scripts/create_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
parser.add_argument("--user", required=True)
parser.add_argument("--pass", required=True)
args = parser.parse_args()
with SessionContextManager(path="mangement_comment:create_user") as session:
with SessionContextManager(path="management_command:create_user") as session:
try:
user = create_user(
session=session, username=args.user, password=getattr(args, "pass")
Expand Down
2 changes: 1 addition & 1 deletion backend/scripts/create_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
if args.token is None:
args.token = utils.get_random_string()

with SessionContextManager(path="mangement_comment:create_worker") as session:
with SessionContextManager(path="management_command:create_worker") as session:
statement = select(Worker).where(Worker.token == args.token)
results = session.exec(statement)
existing_worker = results.one_or_none()
Expand Down
2 changes: 1 addition & 1 deletion backend/scripts/reset_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"--uuid", required=True, type=uuid.UUID, help="Task UUID or Document UUID"
)
args = parser.parse_args()
with SessionContextManager(path="mangement_comment:reset_task") as session:
with SessionContextManager(path="management_command:reset_task") as session:
task = session.execute(
update(Task)
.where(
Expand Down
2 changes: 1 addition & 1 deletion backend/scripts/set_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
parser.add_argument("--pass", required=True)
args = parser.parse_args()

with SessionContextManager(path="mangement_comment:set_password") as session:
with SessionContextManager(path="management_command:set_password") as session:
try:
user = change_user_password(
session=session, username=args.user, new_password=getattr(args, "pass")
Expand Down

0 comments on commit 25a8fb2

Please sign in to comment.