@@ -79,7 +79,7 @@ def sync_challenge(challenge, ignore=[]):
7979 # Create new flags
8080 if challenge .get ("flags" ) and "flags" not in ignore :
8181 # Delete existing flags
82- current_flags = s .get (f "/api/v1/flags" , json = data ).json ()["data" ]
82+ current_flags = s .get ("/api/v1/flags" , json = data ).json ()["data" ]
8383 for flag in current_flags :
8484 if flag ["challenge_id" ] == challenge_id :
8585 flag_id = flag ["id" ]
@@ -88,11 +88,11 @@ def sync_challenge(challenge, ignore=[]):
8888 for flag in challenge ["flags" ]:
8989 if type (flag ) == str :
9090 data = {"content" : flag , "type" : "static" , "challenge_id" : challenge_id }
91- r = s .post (f "/api/v1/flags" , json = data )
91+ r = s .post ("/api/v1/flags" , json = data )
9292 r .raise_for_status ()
9393 elif type (flag ) == dict :
9494 flag ["challenge_id" ] = challenge_id
95- r = s .post (f "/api/v1/flags" , json = flag )
95+ r = s .post ("/api/v1/flags" , json = flag )
9696 r .raise_for_status ()
9797
9898 # Update topics
@@ -110,7 +110,7 @@ def sync_challenge(challenge, ignore=[]):
110110 # Add new challenge topics
111111 for topic in challenge ["topics" ]:
112112 r = s .post (
113- f "/api/v1/topics" ,
113+ "/api/v1/topics" ,
114114 json = {
115115 "value" : topic ,
116116 "type" : "challenge" ,
@@ -122,22 +122,22 @@ def sync_challenge(challenge, ignore=[]):
122122 # Update tags
123123 if challenge .get ("tags" ) and "tags" not in ignore :
124124 # Delete existing tags
125- current_tags = s .get (f "/api/v1/tags" , json = data ).json ()["data" ]
125+ current_tags = s .get ("/api/v1/tags" , json = data ).json ()["data" ]
126126 for tag in current_tags :
127127 if tag ["challenge_id" ] == challenge_id :
128128 tag_id = tag ["id" ]
129129 r = s .delete (f"/api/v1/tags/{ tag_id } " , json = True )
130130 r .raise_for_status ()
131131 for tag in challenge ["tags" ]:
132132 r = s .post (
133- f "/api/v1/tags" , json = {"challenge_id" : challenge_id , "value" : tag }
133+ "/api/v1/tags" , json = {"challenge_id" : challenge_id , "value" : tag }
134134 )
135135 r .raise_for_status ()
136136
137137 # Upload files
138138 if challenge .get ("files" ) and "files" not in ignore :
139139 # Delete existing files
140- all_current_files = s .get (f "/api/v1/files?type=challenge" , json = data ).json ()[
140+ all_current_files = s .get ("/api/v1/files?type=challenge" , json = data ).json ()[
141141 "data"
142142 ]
143143 for f in all_current_files :
@@ -158,13 +158,13 @@ def sync_challenge(challenge, ignore=[]):
158158
159159 data = {"challenge_id" : challenge_id , "type" : "challenge" }
160160 # Specifically use data= here instead of json= to send multipart/form-data
161- r = s .post (f "/api/v1/files" , files = files , data = data )
161+ r = s .post ("/api/v1/files" , files = files , data = data )
162162 r .raise_for_status ()
163163
164164 # Create hints
165165 if challenge .get ("hints" ) and "hints" not in ignore :
166166 # Delete existing hints
167- current_hints = s .get (f "/api/v1/hints" , json = data ).json ()["data" ]
167+ current_hints = s .get ("/api/v1/hints" , json = data ).json ()["data" ]
168168 for hint in current_hints :
169169 if hint ["challenge_id" ] == challenge_id :
170170 hint_id = hint ["id" ]
@@ -181,7 +181,7 @@ def sync_challenge(challenge, ignore=[]):
181181 "challenge_id" : challenge_id ,
182182 }
183183
184- r = s .post (f "/api/v1/hints" , json = data )
184+ r = s .post ("/api/v1/hints" , json = data )
185185 r .raise_for_status ()
186186
187187 # Update requirements
@@ -246,18 +246,18 @@ def create_challenge(challenge, ignore=[]):
246246 for flag in challenge ["flags" ]:
247247 if type (flag ) == str :
248248 data = {"content" : flag , "type" : "static" , "challenge_id" : challenge_id }
249- r = s .post (f "/api/v1/flags" , json = data )
249+ r = s .post ("/api/v1/flags" , json = data )
250250 r .raise_for_status ()
251251 elif type (flag ) == dict :
252252 flag ["challenge" ] = challenge_id
253- r = s .post (f "/api/v1/flags" , json = flag )
253+ r = s .post ("/api/v1/flags" , json = flag )
254254 r .raise_for_status ()
255255
256256 # Create topics
257257 if challenge .get ("topics" ) and "topics" not in ignore :
258258 for topic in challenge ["topics" ]:
259259 r = s .post (
260- f "/api/v1/topics" ,
260+ "/api/v1/topics" ,
261261 json = {
262262 "value" : topic ,
263263 "type" : "challenge" ,
@@ -270,7 +270,7 @@ def create_challenge(challenge, ignore=[]):
270270 if challenge .get ("tags" ) and "tags" not in ignore :
271271 for tag in challenge ["tags" ]:
272272 r = s .post (
273- f "/api/v1/tags" , json = {"challenge_id" : challenge_id , "value" : tag }
273+ "/api/v1/tags" , json = {"challenge_id" : challenge_id , "value" : tag }
274274 )
275275 r .raise_for_status ()
276276
@@ -288,7 +288,7 @@ def create_challenge(challenge, ignore=[]):
288288
289289 data = {"challenge_id" : challenge_id , "type" : "challenge" }
290290 # Specifically use data= here instead of json= to send multipart/form-data
291- r = s .post (f "/api/v1/files" , files = files , data = data )
291+ r = s .post ("/api/v1/files" , files = files , data = data )
292292 r .raise_for_status ()
293293
294294 # Add hints
@@ -303,7 +303,7 @@ def create_challenge(challenge, ignore=[]):
303303 "challenge_id" : challenge_id ,
304304 }
305305
306- r = s .post (f "/api/v1/hints" , json = data )
306+ r = s .post ("/api/v1/hints" , json = data )
307307 r .raise_for_status ()
308308
309309 # Add requirements
0 commit comments