def accept(self): ''' turn this request into the real deal''' user = self.user_object activity = activitypub.Accept(id=self.get_remote_id(status='accepts'), actor=self.user_object.remote_id, object=self.to_activity()).serialize() with transaction.atomic(): UserFollows.from_request(self) self.delete() self.broadcast(activity, user)
def accept(self): """ turn this request into the real deal""" user = self.user_object if not self.user_subject.local: activity = activitypub.Accept( id=self.get_remote_id(status="accepts"), actor=self.user_object.remote_id, object=self.to_activity(), ).serialize() self.broadcast(activity, user) with transaction.atomic(): UserFollows.from_request(self) self.delete()
def to_accept_activity(self): ''' generate an Accept for this follow request ''' return activitypub.Accept(id=self.get_remote_id(status='accepts'), actor=self.user_object.remote_id, object=self.to_activity()).serialize()