From 992f45000438c169e1497915fe30d85497ca7f52 Mon Sep 17 00:00:00 2001 From: BoYanZh Date: Sun, 21 Sep 2025 04:56:14 -0700 Subject: [PATCH] feat: check current gitea user for joj3 --- .pre-commit-config.yaml | 2 +- joint_teapot/app.py | 5 +++++ joint_teapot/workers/gitea.py | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b79523..4e73ee5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -17,7 +17,7 @@ repos: hooks: - id: pyupgrade - repo: https://github.com/hadialqattan/pycln - rev: v2.4.0 + rev: v2.5.0 hooks: - id: pycln args: [-a] diff --git a/joint_teapot/app.py b/joint_teapot/app.py index e83b014..23e71f8 100644 --- a/joint_teapot/app.py +++ b/joint_teapot/app.py @@ -34,6 +34,11 @@ class Tea: tea = Tea() # lazy loader +@app.command("get-gitea-user") +def get_gitea_user() -> None: + tea.pot.gitea.get_user() + + @app.command("export-users", help="export users from canvas to csv file") def export_users_to_csv(output_file: Path = Argument("students.csv")) -> None: tea.pot.canvas.export_users_to_csv(output_file) diff --git a/joint_teapot/workers/gitea.py b/joint_teapot/workers/gitea.py index 159633a..93b473f 100644 --- a/joint_teapot/workers/gitea.py +++ b/joint_teapot/workers/gitea.py @@ -110,6 +110,10 @@ class Gitea: + "but not found in Canvas students" ) + def get_user(self) -> None: + user = self.user_api.user_get_current() + logger.info(f"Current user: {user}") + def create_personal_repos_for_canvas_students( self, students: PaginatedList,