fix: name format (#51)
This commit is contained in:
parent
3ab340f688
commit
34539f435e
|
@ -36,9 +36,9 @@ class Canvas:
|
||||||
types = ["student"]
|
types = ["student"]
|
||||||
|
|
||||||
def patch_student(student: User) -> User:
|
def patch_student(student: User) -> User:
|
||||||
student.name = re.sub(
|
student.name = (
|
||||||
r"[^\x00-\x7F]+", "", student.name
|
re.sub(r"[^\x00-\x7F]+", "", student.name).strip().title()
|
||||||
).strip() # We only care english name
|
) # We only care english name
|
||||||
student.sis_id = student.login_id
|
student.sis_id = student.login_id
|
||||||
student.login_id = student.email.split("@")[0]
|
student.login_id = student.email.split("@")[0]
|
||||||
return student
|
return student
|
||||||
|
|
Loading…
Reference in New Issue
Block a user