Skip to content

Commit

Permalink
fix max number loans
Browse files Browse the repository at this point in the history
  • Loading branch information
Lysquid committed Sep 19, 2023
1 parent 0cc6aed commit f0fc702
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions asso/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def can_make_loan(member_id):
raise ValidationError(f"{member} n'a pas encore cotisé cette année")
if not member.can_make_loan:
raise ValidationError("Il faut être Membre+ pour pouvoir emprunter")
if member.loan_set.count() > Member.MAX_NB_LOANS:
raise ValidationError(f"{member} à dépassé le quota des {Loan.MAX_LOAN_LENGTH} emprunts maximums")
if member.loan_set.current_loans().count() > Member.MAX_NB_LOANS:
raise ValidationError(f"{member} à dépassé le quota des {Member.MAX_NB_LOANS} emprunts maximums")


def _last_loan_member():
Expand Down

0 comments on commit f0fc702

Please sign in to comment.