Exemple #1
0
    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)
Exemple #2
0
 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()
Exemple #3
0
 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()