feat: export email in export-users
All checks were successful
build / trigger-build-image (push) Successful in 30s
All checks were successful
build / trigger-build-image (push) Successful in 30s
This commit is contained in:
parent
14154fb59b
commit
d28fdaf492
|
@ -39,6 +39,14 @@ def export_users_to_csv(output_file: Path = Argument("students.csv")) -> None:
|
||||||
tea.pot.canvas.export_users_to_csv(output_file)
|
tea.pot.canvas.export_users_to_csv(output_file)
|
||||||
|
|
||||||
|
|
||||||
|
@app.command(
|
||||||
|
"export-wrong-email-users",
|
||||||
|
help="export users with wrong email from canvas in stdout",
|
||||||
|
)
|
||||||
|
def export_wrong_email_users() -> None:
|
||||||
|
tea.pot.canvas.export_wrong_email_users()
|
||||||
|
|
||||||
|
|
||||||
@app.command(
|
@app.command(
|
||||||
"invite-to-teams", help="invite all canvas students to gitea teams by team name"
|
"invite-to-teams", help="invite all canvas students to gitea teams by team name"
|
||||||
)
|
)
|
||||||
|
|
|
@ -61,6 +61,11 @@ class Canvas:
|
||||||
self.grade_filename = grade_filename
|
self.grade_filename = grade_filename
|
||||||
logger.debug("Canvas initialized")
|
logger.debug("Canvas initialized")
|
||||||
|
|
||||||
|
def export_wrong_email_users(self) -> None:
|
||||||
|
for user in self.users:
|
||||||
|
if not user.email.endswith("@sjtu.edu.cn"):
|
||||||
|
print(user.email)
|
||||||
|
|
||||||
def export_users_to_csv(self, filename: Path) -> None:
|
def export_users_to_csv(self, filename: Path) -> None:
|
||||||
with open(filename, mode="w", newline="") as file:
|
with open(filename, mode="w", newline="") as file:
|
||||||
writer = csv.writer(file)
|
writer = csv.writer(file)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user