Skip to content

Commit

Permalink
Re-add use of % for gettext_lazy interpolation
Browse files Browse the repository at this point in the history
  • Loading branch information
Lymkwi committed Oct 26, 2023
1 parent e3f05c6 commit fa4d059
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions insalan/payment/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ class Meta:
@staticmethod
def new(**data):
"""create a new transaction based on products id list and a payer"""
logger.debug(f"in the constructor {data}")
fields = {}
fields["creation_date"] = timezone.make_aware(datetime.now())
fields["last_modification_date"] = fields["creation_date"]
Expand All @@ -168,17 +167,15 @@ def new(**data):
if not pid.can_be_bought_now():
raise ValidationError(
{
"error": _(
"Le produit %(id)s est actuellement indisponible"
).format(id=pid.id)
"error": _("Le produit %(id)s est actuellement indisponible")
% {"id": pid.id}
}
)
if pid.associated_tournament and not pid.associated_tournament.is_announced:
raise ValidationError(
{
"error": _(
"Le tournoi %(id)s est actuellement indisponible"
).format(id=pid.associated_tournament.id)
"error": _("Le tournoi %(id)s est actuellement indisponible")
% {"id": pid.associated_tournament.id}
}
)
count = len(list(grouper))
Expand Down

0 comments on commit fa4d059

Please sign in to comment.