Skip to content

Commit 6aea14e

Browse files
committed
Resolve ruff check warnings
1 parent cfed044 commit 6aea14e

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
@@ -512,11 +512,10 @@ def validate(self, data):
512512
except models.Manifest.DoesNotExist:
513513
raise serializers.ValidationError(
514514
_(
515-
"A manifest with the digest '{}' does not "
516-
"exist in the latest repository version '{}'".format(
517-
new_data["digest"], latest_version
518-
)
515+
"A manifest with the digest '%s' does not "
516+
"exist in the latest repository version '%s'"
519517
)
518+
% (new_data["digest"], latest_version)
520519
)
521520

522521
new_data["manifest"] = manifest
@@ -541,11 +540,8 @@ def validate(self, data):
541540
models.Tag.objects.get(pk__in=latest_version.content.all(), name=new_data["tag"])
542541
except models.Tag.DoesNotExist:
543542
raise serializers.ValidationError(
544-
_(
545-
"The tag '{}' does not exist in the latest repository version '{}'".format(
546-
new_data["tag"], latest_version
547-
)
548-
)
543+
_("The tag '%s' does not exist in the latest repository version '%s'")
544+
% (new_data["tag"], latest_version)
549545
)
550546

551547
return new_data
@@ -570,7 +566,7 @@ def validate(self, data):
570566
if content_units:
571567
if "*" in content_units and len(content_units) > 1:
572568
raise serializers.ValidationError(
573-
_("'*' should be the only item present in the {}".format(content_units))
569+
_("'*' should be the only item present in the {}").format(content_units)
574570
)
575571
return data
576572

@@ -664,11 +660,10 @@ def validate(self, data):
664660
except models.Manifest.DoesNotExist:
665661
raise serializers.ValidationError(
666662
_(
667-
"A manifest with the digest '{}' does not "
668-
"exist in the latest repository version '{}'".format(
669-
new_data["digest"], latest_version
670-
)
663+
"A manifest with the digest '%s' does not "
664+
"exist in the latest repository version '%s'"
671665
)
666+
% (new_data["digest"], latest_version)
672667
)
673668

674669
new_data["manifest"] = manifest
@@ -707,11 +702,10 @@ def validate(self, data):
707702
if not sigs_pks:
708703
raise serializers.ValidationError(
709704
_(
710-
"There are no signatures in the latest repository version '{}' "
711-
"produced with the specified key_id '{}'".format(
712-
latest_version, new_data["signed_with_key_id"]
713-
)
705+
"There are no signatures in the latest repository version '%s' "
706+
"produced with the specified key_id '%s'"
714707
)
708+
% (latest_version, new_data["signed_with_key_id"])
715709
)
716710

717711
new_data["sigs_pks"] = sigs_pks

0 commit comments

Comments
 (0)