diff --git a/bookwyrm/remote_user.py b/bookwyrm/remote_user.py index 9aa6079e..23a805b3 100644 --- a/bookwyrm/remote_user.py +++ b/bookwyrm/remote_user.py @@ -1,9 +1,7 @@ ''' manage remote users ''' from urllib.parse import urlparse -from uuid import uuid4 import requests -from django.core.files.base import ContentFile from django.db import transaction from bookwyrm import activitypub, models @@ -22,7 +20,7 @@ def get_or_create_remote_user(actor): actor_parts = urlparse(actor) with transaction.atomic(): - user = create_remote_user(data) + user = activitypub.Person(**data).to_model(models.User) user.federated_server = get_or_create_remote_server(actor_parts.netloc) user.save() if user.bookwyrm_user: @@ -50,12 +48,6 @@ def fetch_user_data(actor): return data -def create_remote_user(data): - ''' parse the activitypub actor data into a user ''' - actor = activitypub.Person(**data) - return actor.to_model(models.User) - - def refresh_remote_user(user): ''' get updated user data from its home instance ''' data = fetch_user_data(user.remote_id)