File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
fedcode/management/commands Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 99
1010from traceback import format_exc as traceback_format_exc
1111
12+ import requests
1213from django .core .management .base import BaseCommand
1314
1415from fedcode .models import FederateRequest
1718
1819
1920def send_fed_req_task ():
20- """
21- send_fed_req_task is a task to send the http signed request to the target and save the status of the request
22- """
21+ """Send activity request to the target and save the status."""
22+
2323 for rq in FederateRequest .objects .all ().order_by ("created_at" ):
2424 if not rq .done :
2525 try :
26- HttpSignature .signed_request (
27- rq .target , rq .body , FEDERATEDCODE_PRIVATE_KEY , rq .key_id
28- )
26+ headers = {"Content-Type" : "application/json" }
27+ requests .post (rq .target , json = rq .body , headers = headers )
2928 rq .done = True
3029 rq .save ()
3130 except Exception as e :
32- rq .error_message = e
31+ rq .error_message = f"Failed to federate { rq !r } { e !r } \n { traceback_format_exc () } "
3332 finally :
3433 rq .save ()
3534
You can’t perform that action at this time.
0 commit comments