fix: name format (#51)

This commit is contained in:
mQzLjP 2025-02-23 23:02:57 +08:00 committed by GitHub
parent 3ab340f688
commit 34539f435e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -36,9 +36,9 @@ class Canvas:
types = ["student"]
def patch_student(student: User) -> User:
student.name = re.sub(
r"[^\x00-\x7F]+", "", student.name
).strip() # We only care english name
student.name = (
re.sub(r"[^\x00-\x7F]+", "", student.name).strip().title()
) # We only care english name
student.sis_id = student.login_id
student.login_id = student.email.split("@")[0]
return student