@@ -45,7 +45,7 @@ class Challenge(dict):
4545 # fmt: off
4646 "name" , "author" , "category" , "description" , "attribution" , "value" ,
4747 "type" , "extra" , "image" , "protocol" , "host" ,
48- "connection_info" , "healthcheck" , "attempts" , "flags" ,
48+ "connection_info" , "healthcheck" , "attempts" , "logic" , " flags" ,
4949 "files" , "topics" , "tags" , "files" , "hints" ,
5050 "requirements" , "next" , "state" , "version" ,
5151 # fmt: on
@@ -291,6 +291,9 @@ def _get_initial_challenge_payload(self, ignore: Tuple[str] = ()) -> Dict:
291291 if "connection_info" not in ignore :
292292 challenge_payload ["connection_info" ] = challenge .get ("connection_info" , None )
293293
294+ if "logic" not in ignore :
295+ challenge_payload ["logic" ] = challenge .get ("logic" , "any" )
296+
294297 if "extra" not in ignore :
295298 challenge_payload = {** challenge_payload , ** challenge .get ("extra" , {})}
296299
@@ -552,13 +555,16 @@ def _normalize_challenge(self, challenge_data: Dict[str, Any]):
552555 "type" ,
553556 "state" ,
554557 "connection_info" ,
558+ "logic" ,
555559 ]
556560 for key in copy_keys :
557561 if key in challenge_data :
558562 challenge [key ] = challenge_data [key ]
559563
560564 challenge ["description" ] = challenge_data ["description" ].strip ().replace ("\r \n " , "\n " ).replace ("\t " , "" )
561- challenge ["attribution" ] = challenge_data .get ("attribution" , "" ).strip ().replace ("\r \n " , "\n " ).replace ("\t " , "" )
565+ challenge ["attribution" ] = challenge_data .get ("attribution" , "" )
566+ if challenge ["attribution" ]:
567+ challenge ["attribution" ] = challenge ["attribution" ].strip ().replace ("\r \n " , "\n " ).replace ("\t " , "" )
562568 challenge ["attempts" ] = challenge_data ["max_attempts" ]
563569
564570 for key in ["initial" , "decay" , "minimum" ]:
0 commit comments