Skip to content

Commit 6126971

Browse files
committed
Resolve ruff check warnings
1 parent c5a59ee commit 6126971

1 file changed

Lines changed: 12 additions & 18 deletions

File tree

pulp_container/app/serializers.py

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -589,11 +589,10 @@ def validate(self, data):
589589
except models.Manifest.DoesNotExist:
590590
raise serializers.ValidationError(
591591
_(
592-
"A manifest with the digest '{}' does not "
593-
"exist in the latest repository version '{}'".format(
594-
new_data["digest"], latest_version
595-
)
592+
"A manifest with the digest '%s' does not "
593+
"exist in the latest repository version '%s'"
596594
)
595+
% (new_data["digest"], latest_version)
597596
)
598597

599598
new_data["manifest"] = manifest
@@ -618,11 +617,8 @@ def validate(self, data):
618617
models.Tag.objects.get(pk__in=latest_version.content.all(), name=new_data["tag"])
619618
except models.Tag.DoesNotExist:
620619
raise serializers.ValidationError(
621-
_(
622-
"The tag '{}' does not exist in the latest repository version '{}'".format(
623-
new_data["tag"], latest_version
624-
)
625-
)
620+
_("The tag '%s' does not exist in the latest repository version '%s'")
621+
% (new_data["tag"], latest_version)
626622
)
627623

628624
return new_data
@@ -647,7 +643,7 @@ def validate(self, data):
647643
if content_units:
648644
if "*" in content_units and len(content_units) > 1:
649645
raise serializers.ValidationError(
650-
f"'*' should be the only item present in the {content_units}"
646+
_("'*' should be the only item present in the %s") % content_units
651647
)
652648
return data
653649

@@ -741,11 +737,10 @@ def validate(self, data):
741737
except models.Manifest.DoesNotExist:
742738
raise serializers.ValidationError(
743739
_(
744-
"A manifest with the digest '{}' does not "
745-
"exist in the latest repository version '{}'".format(
746-
new_data["digest"], latest_version
747-
)
740+
"A manifest with the digest '%s' does not "
741+
"exist in the latest repository version '%s'"
748742
)
743+
% (new_data["digest"], latest_version)
749744
)
750745

751746
new_data["manifest"] = manifest
@@ -784,11 +779,10 @@ def validate(self, data):
784779
if not sigs_pks:
785780
raise serializers.ValidationError(
786781
_(
787-
"There are no signatures in the latest repository version '{}' "
788-
"produced with the specified key_id '{}'".format(
789-
latest_version, new_data["signed_with_key_id"]
790-
)
782+
"There are no signatures in the latest repository version '%s' "
783+
"produced with the specified key_id '%s'"
791784
)
785+
% (latest_version, new_data["signed_with_key_id"])
792786
)
793787

794788
new_data["sigs_pks"] = sigs_pks

0 commit comments

Comments
 (0)