summaryrefslogtreecommitdiffstats
path: root/users
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-20 17:17:53 -0700
committerAndrew Godwin2022-11-20 17:18:25 -0700
commitbed5c7ffaa184fd6146df17279fc2b96f9d02944 (patch)
tree4e1e858ebe85a8faa0e2c6c5aebde61d87fb3036 /users
parenta351c6b1175937f53fb208fbeaa1d39bf8a2fb72 (diff)
downloadtakahe-bed5c7ffaa184fd6146df17279fc2b96f9d02944.tar.gz
takahe-bed5c7ffaa184fd6146df17279fc2b96f9d02944.tar.bz2
takahe-bed5c7ffaa184fd6146df17279fc2b96f9d02944.zip
Don't error when retrieving existing user
Happens when a user is not yet fetched but we look them up via a successful webfinger
Diffstat (limited to 'users')
-rw-r--r--users/models/identity.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/users/models/identity.py b/users/models/identity.py
index c80d9d9..2190c9c 100644
--- a/users/models/identity.py
+++ b/users/models/identity.py
@@ -165,6 +165,12 @@ class Identity(StatorModel):
)
if handle is None:
return None
+ # See if this actually does match an existing actor
+ try:
+ return cls.objects.get(actor_uri=actor_uri)
+ except cls.DoesNotExist:
+ pass
+ # OK, make one
username, domain = handle.split("@")
domain = Domain.get_remote_domain(domain)
return cls.objects.create(