mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 03:49:24 +00:00
ruff rule FBT
This commit is contained in:
@ -128,7 +128,7 @@ class Customer(models.Model):
|
||||
account = cls.objects.create(user=user, account_id=account_id)
|
||||
return account, True
|
||||
|
||||
def save(self, allow_negative=False, is_selling=False, *args, **kwargs):
|
||||
def save(self, *args, allow_negative=False, is_selling=False, **kwargs):
|
||||
"""
|
||||
is_selling : tell if the current action is a selling
|
||||
allow_negative : ignored if not a selling. Allow a selling to put the account in negative
|
||||
@ -776,7 +776,7 @@ class Selling(models.Model):
|
||||
}
|
||||
self.customer.user.email_user(subject, message_txt, html_message=message_html)
|
||||
|
||||
def save(self, allow_negative=False, *args, **kwargs):
|
||||
def save(self, *args, allow_negative=False, **kwargs):
|
||||
"""
|
||||
allow_negative : Allow this selling to use more money than available for this user
|
||||
"""
|
||||
|
@ -1695,7 +1695,7 @@ class StudentCardFormView(FormView):
|
||||
)
|
||||
|
||||
|
||||
def __manage_billing_info_req(request, user_id, delete_if_fail=False):
|
||||
def __manage_billing_info_req(request, user_id, *, delete_if_fail=False):
|
||||
data = json.loads(request.body)
|
||||
form = BillingInfoForm(data)
|
||||
if not form.is_valid():
|
||||
@ -1725,7 +1725,7 @@ def create_billing_info(request, user_id):
|
||||
user = get_object_or_404(User, pk=user_id)
|
||||
customer, _ = Customer.get_or_create(user)
|
||||
BillingInfo.objects.create(customer=customer)
|
||||
return __manage_billing_info_req(request, user_id, True)
|
||||
return __manage_billing_info_req(request, user_id, delete_if_fail=True)
|
||||
|
||||
|
||||
@login_required
|
||||
|
Reference in New Issue
Block a user