File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -220,9 +220,14 @@ def decorator(
220220 ) -> Callable [typing .Concatenate [_Self , _P ], _R | None ]:
221221 @wraps (func )
222222 def wrapped (self : _Self , * args : _P .args , ** kwargs : _P .kwargs ):
223- if self .r_params ["actual_phase" ] not in actual_phases and \
224- (self .current_user is None or
225- not self .current_user .unrestricted ):
223+ unrestricted = self .current_user is not None and self .current_user .unrestricted
224+ if self .impersonated_by_admin :
225+ try :
226+ unrestricted = self .get_boolean_argument ("override_phase_check" , unrestricted )
227+ except ValueError as err :
228+ self .json ({"error" : str (err )}, 400 )
229+ return
230+ if self .r_params ["actual_phase" ] not in actual_phases and not unrestricted :
226231 if self .is_api ():
227232 if set (actual_phases ) <= {0 , 3 }:
228233 self .json ({"error" : "The contest is not open" }, 403 )
You can’t perform that action at this time.
0 commit comments