use f-string annotation

This commit is contained in:
Matthias 2022-02-20 21:47:39 +01:00
parent 0baffcaee5
commit b974b5fc30
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -620,7 +620,7 @@ class DataFileExtractSerializer(serializers.Serializer):
# Check for missing required columns
if required:
if name not in self.columns:
raise serializers.ValidationError(_("Missing required column: '{name}'"))
raise serializers.ValidationError(_(f"Missing required column: '{name}'"))
for col in self.columns:
@ -629,7 +629,7 @@ class DataFileExtractSerializer(serializers.Serializer):
# Check for duplicated columns
if col in cols_seen:
raise serializers.ValidationError(_("Duplicate column: '{col}'"))
raise serializers.ValidationError(_(f"Duplicate column: '{col}'"))
cols_seen.add(col)