@@ -360,7 +360,7 @@ def validate_attestations(self, value):
360360 else :
361361 attestations = TypeAdapter (list [Attestation ]).validate_python (value )
362362 except ValidationError as e :
363- raise serializers .ValidationError (_ ("Invalid attestations: {}" .format (e ) ))
363+ raise serializers .ValidationError (_ ("Invalid attestations: {}" ) .format (e ))
364364 return attestations
365365
366366 def handle_attestations (self , filename , sha256 , attestations , offline = True ):
@@ -373,7 +373,7 @@ def handle_attestations(self, filename, sha256, attestations, offline=True):
373373 verify_provenance (filename , sha256 , provenance , offline = offline )
374374 except AttestationError as e :
375375 raise serializers .ValidationError (
376- {"attestations" : _ ("Attestations failed verification: {}" .format (e ) )}
376+ {"attestations" : _ ("Attestations failed verification: {}" ) .format (e )}
377377 )
378378 return provenance .model_dump (mode = "json" )
379379
@@ -628,13 +628,13 @@ def deferred_validate(self, data):
628628 data ["provenance" ] = provenance .model_dump (mode = "json" )
629629 except ValidationError as e :
630630 raise serializers .ValidationError (
631- _ ("The uploaded provenance is not valid: {}" .format (e ) )
631+ _ ("The uploaded provenance is not valid: {}" ) .format (e )
632632 )
633633 if data .pop ("verify" ):
634634 try :
635635 verify_provenance (data ["package" ].filename , data ["package" ].sha256 , provenance )
636636 except AttestationError as e :
637- raise serializers .ValidationError (_ ("Provenance verification failed: {}" .format (e ) ))
637+ raise serializers .ValidationError (_ ("Provenance verification failed: {}" ) .format (e ))
638638 return data
639639
640640 def retrieve (self , validated_data ):
@@ -737,7 +737,7 @@ def validate_includes(self, value):
737737 Requirement (pkg )
738738 except ValueError as ve :
739739 raise serializers .ValidationError (
740- _ ("includes specifier {} is invalid. {}" .format (pkg , ve ) )
740+ _ ("includes specifier {} is invalid. {}" ) .format (pkg , ve )
741741 )
742742 return value
743743
@@ -748,7 +748,7 @@ def validate_excludes(self, value):
748748 Requirement (pkg )
749749 except ValueError as ve :
750750 raise serializers .ValidationError (
751- _ ("excludes specifier {} is invalid. {}" .format (pkg , ve ) )
751+ _ ("excludes specifier {} is invalid. {}" ) .format (pkg , ve )
752752 )
753753 return value
754754
0 commit comments