diff options
author | Andrew Godwin | 2022-11-16 23:10:55 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-16 23:10:55 -0700 |
commit | 7f8e792402b66dbb4a721be4f44306d528931b86 (patch) | |
tree | 8e423ef8cac2be69ef426b13f90ec57faf4ac42b /users/models | |
parent | 716d8a766ae0c4e2539f2df601269a3203bcd715 (diff) | |
download | takahe-7f8e792402b66dbb4a721be4f44306d528931b86.tar.gz takahe-7f8e792402b66dbb4a721be4f44306d528931b86.tar.bz2 takahe-7f8e792402b66dbb4a721be4f44306d528931b86.zip |
Force username to lowercase for now
Diffstat (limited to 'users/models')
-rw-r--r-- | users/models/identity.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/users/models/identity.py b/users/models/identity.py index ba8559b..4bbaeaf 100644 --- a/users/models/identity.py +++ b/users/models/identity.py @@ -134,6 +134,7 @@ class Identity(StatorModel): def by_username_and_domain(cls, username, domain, fetch=False, local=False): if username.startswith("@"): raise ValueError("Username must not start with @") + username = username.lower() try: if local: return cls.objects.get(username=username, domain_id=domain, local=True) @@ -281,6 +282,8 @@ class Identity(StatorModel): self.username = document.get("preferredUsername") if self.username and "@value" in self.username: self.username = self.username["@value"] + if self.username: + self.username = self.username.lower() self.manually_approves_followers = document.get( "as:manuallyApprovesFollowers" ) |