From bed5c7ffaa184fd6146df17279fc2b96f9d02944 Mon Sep 17 00:00:00 2001 From: Andrew Godwin Date: Sun, 20 Nov 2022 17:17:53 -0700 Subject: Don't error when retrieving existing user Happens when a user is not yet fetched but we look them up via a successful webfinger --- users/models/identity.py | 6 ++++++ 1 file changed, 6 insertions(+) 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( -- cgit v1.2.3