From f654444aab261ad52e5c973ca883e4797a0a0446 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Mon, 22 Feb 2021 08:53:01 -0800 Subject: [PATCH] Fixes bug in saving remote server --- bookwyrm/models/user.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index 7b0f9a91..170b587e 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -171,15 +171,15 @@ class User(OrderedCollectionPageMixin, AbstractUser): def save(self, *args, **kwargs): ''' populate fields for new local users ''' + created = not bool(self.id) if not self.local and not re.match(regex.full_username, self.username): # generate a username that uses the domain (webfinger format) actor_parts = urlparse(self.remote_id) self.username = '%s@%s' % (self.username, actor_parts.netloc) super().save(*args, **kwargs) - return # this user already exists, no need to populate fields - if self.id: + if created: super().save(*args, **kwargs) return